homegames-common 1.1.0 → 1.1.1

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 +17 -1
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -607,7 +607,22 @@ const authWorkflow = (authPath) => new Promise((resolve, reject) => {
607
607
  });
608
608
  });
609
609
 
610
- const log = process.env.LOGGER_LOCATION ? require(process.env.LOGGER_LOCATION) : { info: (msg) => console.log(msg), error: (msg) => console.error(msg)};
610
+ let electronLog = null;
611
+ try {
612
+ electronLog = require('electron-log');
613
+ } catch (err) {
614
+ console.log('not running with electron');
615
+ }
616
+
617
+ const defaultLog = { info: (msg) => console.log(msg), error: (msg) => console.error(msg)};
618
+
619
+ const log = electronLog == null ?
620
+ (
621
+ process.env.LOGGER_LOCATION ?
622
+ require(process.env.LOGGER_LOCATION) : defaultLog
623
+ ) : electronLog;
624
+
625
+ log.info('doing this');
611
626
 
612
627
  const getConfigValue = (key, _default = undefined) => {
613
628
  const config = getConfig();
@@ -725,3 +740,4 @@ module.exports = {
725
740
  getAppDataPath
726
741
  };
727
742
 
743
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homegames-common",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Homegames common tools",
5
5
  "main": "index.js",
6
6
  "scripts": {