homegames-common 1.1.0 → 1.1.2

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 +19 -2
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -36,7 +36,8 @@ const DEFAULT_CONFIG = {
36
36
  "TESTS_ENABLED": true,
37
37
  "API_URL": "https://api.homegames.io",
38
38
  "LINK_PROXY_URL": "wss://public.homegames.link:81",
39
- "LINK_URL": "wss://homegames.link"
39
+ "LINK_URL": "wss://homegames.link",
40
+ "MAP_ENABLED" false
40
41
  }
41
42
 
42
43
  const getLocalIP = () => {
@@ -607,7 +608,22 @@ const authWorkflow = (authPath) => new Promise((resolve, reject) => {
607
608
  });
608
609
  });
609
610
 
610
- const log = process.env.LOGGER_LOCATION ? require(process.env.LOGGER_LOCATION) : { info: (msg) => console.log(msg), error: (msg) => console.error(msg)};
611
+ let electronLog = null;
612
+ try {
613
+ electronLog = require('electron-log');
614
+ } catch (err) {
615
+ console.log('not running with electron');
616
+ }
617
+
618
+ const defaultLog = { info: (msg) => console.log(msg), error: (msg) => console.error(msg)};
619
+
620
+ const log = electronLog == null ?
621
+ (
622
+ process.env.LOGGER_LOCATION ?
623
+ require(process.env.LOGGER_LOCATION) : defaultLog
624
+ ) : electronLog;
625
+
626
+ log.info('doing this');
611
627
 
612
628
  const getConfigValue = (key, _default = undefined) => {
613
629
  const config = getConfig();
@@ -725,3 +741,4 @@ module.exports = {
725
741
  getAppDataPath
726
742
  };
727
743
 
744
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homegames-common",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Homegames common tools",
5
5
  "main": "index.js",
6
6
  "scripts": {