homegames-common 1.0.6 → 1.0.7
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.
- package/index.js +5 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -700,15 +700,16 @@ const log = {
|
|
|
700
700
|
error: (msg, explanation) => {
|
|
701
701
|
if (electronLogger) {
|
|
702
702
|
electronLogger.error(msgToString(msg));
|
|
703
|
-
} else {
|
|
703
|
+
}// else {
|
|
704
704
|
const logLevel = getLogLevel();
|
|
705
705
|
const required = getLogLevel('INFO');
|
|
706
706
|
|
|
707
707
|
if (logLevel < required) {
|
|
708
|
-
|
|
708
|
+
// return;
|
|
709
709
|
}
|
|
710
710
|
|
|
711
|
-
const logPath = getConfigValue('LOG_PATH', 'hg_log.txt');
|
|
711
|
+
//const logPath = getConfigValue('LOG_PATH', 'hg_log.txt');
|
|
712
|
+
const logPath = path.join(getAppDataPath(), 'hg-log.txt');//getConfigValue('LOG_PATH', 'hg_log.txt');
|
|
712
713
|
|
|
713
714
|
const msgString = `[HOMEGAMES-ERROR][${new Date().toTimeString()}] ${msgToString(msg)}${explanation ? ':' + os.EOL + msgToString(explanation) : ''}${os.EOL}${os.EOL}`;
|
|
714
715
|
fs.appendFile(logPath, msgString, (err) => {
|
|
@@ -717,7 +718,7 @@ const log = {
|
|
|
717
718
|
console.log(err);
|
|
718
719
|
}
|
|
719
720
|
});
|
|
720
|
-
}
|
|
721
|
+
//}
|
|
721
722
|
},
|
|
722
723
|
debug: (msg, explanation) => {
|
|
723
724
|
const logLevel = getLogLevel();
|