jamesbarnett91 / tplink-energy-monitor

An energy monitoring dashboard for TP-Link smart plugs
GNU General Public License v3.0
467 stars 104 forks source link

Logging not working (or found) on MacOS #88

Open wkhan69 opened 3 years ago

wkhan69 commented 3 years ago

Hi, I've downloaded the MacOS tplink-monitor-macos tool and ran it. It seems to work fine except I cannot find any logs. The dashboard appears fine, but when I look in the local director that contains the tool executable, there are no logs produced. I even tried running in admin mode (using the sudo command). The terminal output is as follows:

Wills-MBP:~ willkhan$ sudo /Users/willkhan/Downloads/tplink-monitor-macos/tplink-monitor-macos Password: Logger config file: "logger-config.json" Error reading logger config. Reverting to defaults. { Error: ENOENT: no such file or directory, open 'logger-config.json' at Object.fs.openSync (fs.js:646:18) at Object.fs.openSync (pkg/prelude/bootstrap.js:483:32) at Object.fs.readFileSync (fs.js:551:33) at Object.fs.readFileSync (pkg/prelude/bootstrap.js:675:36) at loadLogConfig (/snapshot/tplink-energy-monitor/services/data-logger.js:0:0) at Object. (/snapshot/tplink-energy-monitor/services/data-logger.js:0:0) at Module._compile (pkg/prelude/bootstrap.js:1243:22) at Object.Module._extensions..js (module.js:644:10) at Module.load (module.js:552:32) at tryModuleLoad (module.js:495:12) errno: -2, code: 'ENOENT', syscall: 'open', path: 'logger-config.json' } Log directory path: "." ...

The first error (4th line) , I'm guessing, is not a real error, but just an indication that the tool could not find a custom logging configuration. (I'm fine with the default config). Any ideas?

wkhan69 commented 3 years ago

Problem is fixed: I run it from the command line, explicitly adding the log configuration file. ie: ./tplink-monitor-macos logger-config.json