How can I read this log.log file?
It currently console.log's:
{"type":"Buffer","data":[65,116,116,101,109,112,116,101,100,32,116,111,32,100,105,118,105,100,101,32,98,121,32,122,101,114,111,46,10]}
const displayLogFile = () => {
fs.readFile("./log.log", (err, file) => { //adding "utf-8" only logs a small portion of the .log file, but I was told this might be an async issue.
console.log(file);
});
};
Attempted to divide by zero.
Error: ENOENT: no such file or directory, open './NoFileNamedThis.txt'
at Object.openSync (fs.js:498:3)
at Object.readFileSync (fs.js:394:35)
at fileDoesNotExist (C:\Users.js:33:6)
at Object.<anonymous> (C:\Users:54:3)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
errno: -4058,
syscall: 'open',
code: 'ENOENT',
path: './NoFileNamedThis.txt'
}
Index was outside the bounds of the array.
TypeError: Cannot read property '0' of null
at arrayIsNull (C:\Users:44:6)
at Object.<anonymous> (C:\Users:66:3)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
I would like to console.log() this .log, log file, but it console.log()'s an array buffer.