@opengis/fastify-table 1.1.33 → 1.1.34
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
CHANGED
|
@@ -23,7 +23,7 @@ export default async function loggerFile({
|
|
|
23
23
|
if (access?.status === 403 && !config?.local) return access;
|
|
24
24
|
|
|
25
25
|
// absolute / relative path
|
|
26
|
-
const rootDir = getRootDir(
|
|
26
|
+
const rootDir = getRootDir();
|
|
27
27
|
|
|
28
28
|
const filepath = path.join(rootDir, params['*'] || '');
|
|
29
29
|
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
import path from 'path';
|
|
2
|
-
|
|
2
|
+
import fs from 'fs';
|
|
3
|
+
import config from '../../../config.js';
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
// import { existsSync } from 'fs';
|
|
6
|
+
let logDir = null;
|
|
7
|
+
export default function getRootDir() {
|
|
5
8
|
// absolute / relative path
|
|
6
|
-
if (
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
return
|
|
9
|
+
if (logDir) return logDir;
|
|
10
|
+
const file = ['config.json', '/data/local/config.json'].find(el => (fs.existsSync(el) ? el : null));
|
|
11
|
+
const root = file === 'config.json' ? process.cwd() : '/data/local';
|
|
12
|
+
logDir = config.logDir || path.join(root, config.log?.dir || 'log');
|
|
13
|
+
console.log({ logDir });
|
|
14
|
+
return logDir;
|
|
12
15
|
|
|
13
16
|
// windows debug support
|
|
14
17
|
/* const customLogDir = process.cwd().includes(':') ? 'c:/data/local' : '/data/local';
|