hong-review-cli 1.0.10 → 1.0.11
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/package.json +1 -1
- package/src/utils/logger.js +11 -2
package/package.json
CHANGED
package/src/utils/logger.js
CHANGED
|
@@ -5,7 +5,6 @@ const DailyRotateFile = require('winston-daily-rotate-file');
|
|
|
5
5
|
const fs = require('fs');
|
|
6
6
|
const path = require('path');
|
|
7
7
|
const os = require('os');
|
|
8
|
-
const storage = require('./storage');
|
|
9
8
|
|
|
10
9
|
const spinners = new Map();
|
|
11
10
|
|
|
@@ -16,7 +15,17 @@ class Logger {
|
|
|
16
15
|
|
|
17
16
|
initWinston() {
|
|
18
17
|
// Find log directory setting or default to ~/.hong-review-logs
|
|
19
|
-
|
|
18
|
+
let configLogDir = null;
|
|
19
|
+
try {
|
|
20
|
+
const CONFIG_FILE = process.env.HONG_REVIEW_CONFIG || path.join(os.homedir(), '.hong-review-config.json');
|
|
21
|
+
if (fs.existsSync(CONFIG_FILE)) {
|
|
22
|
+
const configData = JSON.parse(fs.readFileSync(CONFIG_FILE, 'utf-8'));
|
|
23
|
+
configLogDir = configData.logDir;
|
|
24
|
+
}
|
|
25
|
+
} catch (e) {
|
|
26
|
+
// Ignore parse errors here
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
let defaultLogDir = '';
|
|
21
30
|
if (configLogDir) {
|
|
22
31
|
defaultLogDir = configLogDir;
|