homegames-common 1.0.3 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +8 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -666,14 +666,14 @@ const msgToString = (msg) => {
666
666
 
667
667
  let electronLogger = null;
668
668
 
669
- try {
670
- require.resolve('electron-log');
671
- electronLogger = require('electron-log');
672
- } catch (err) {
673
- console.log('Logger not using electron. Logging to file.');
669
+ if (process.env.LOGGER_LOCATION) {
670
+ try {
671
+ electronLogger = require(process.env.LOGGER_LOCATION);
672
+ } catch (err) {
673
+ console.log('Logger not using electron. Logging to file.');
674
+ }
674
675
  }
675
676
 
676
-
677
677
  const log = {
678
678
  info: (msg, explanation = null) => {
679
679
  if (electronLogger) {
@@ -683,10 +683,10 @@ const log = {
683
683
  const required = getLogLevel('INFO');
684
684
 
685
685
  if (logLevel < required) {
686
- return;
686
+ // return;
687
687
  }
688
688
 
689
- const logPath = getConfigValue('LOG_PATH', 'hg_log.txt');
689
+ const logPath = path.join(getAppDataPath(), 'hg-log.txt');//getConfigValue('LOG_PATH', 'hg_log.txt');
690
690
 
691
691
  const msgString = `[HOMEGAMES-INFO][${new Date().toTimeString()}] ${msgToString(msg)}${explanation ? ':' + os.EOL + msgToString(explanation) : ''}${os.EOL}${os.EOL}`;
692
692
  fs.appendFile(logPath, msgString, (err) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homegames-common",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Homegames common tools",
5
5
  "main": "index.js",
6
6
  "scripts": {