marmot-logger 1.0.4 → 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.
- package/package.json +1 -1
- package/src/core/config.js +7 -2
package/package.json
CHANGED
package/src/core/config.js
CHANGED
|
@@ -6,7 +6,7 @@ const CONFIG_FILE = '.marmotrc.json';
|
|
|
6
6
|
const MARMOT_TMP_BASE = '/tmp/marmot';
|
|
7
7
|
|
|
8
8
|
const DEFAULT_CONFIG = {
|
|
9
|
-
logDir:
|
|
9
|
+
logDir: null, // null means use marmot temp dir (default)
|
|
10
10
|
bearerToken: 'broken-bearer',
|
|
11
11
|
plugins: {
|
|
12
12
|
'file-monitor': {
|
|
@@ -122,7 +122,12 @@ function getApiKey(projectDir = process.cwd()) {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
function getLogDir(config, projectDir = process.cwd()) {
|
|
125
|
-
|
|
125
|
+
if (config.logDir) {
|
|
126
|
+
// Custom log dir specified - resolve relative to project
|
|
127
|
+
return path.resolve(projectDir, config.logDir);
|
|
128
|
+
}
|
|
129
|
+
// Default: use marmot temp dir
|
|
130
|
+
return path.join(getMarmotDir(projectDir), 'logs');
|
|
126
131
|
}
|
|
127
132
|
|
|
128
133
|
function getSnapshotDir(config, projectDir = process.cwd()) {
|