forked from parse-community/parse-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
logger.js
33 lines (27 loc) · 817 Bytes
/
logger.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
'use strict';
import defaults from './defaults';
import { WinstonLoggerAdapter } from './Adapters/Logger/WinstonLoggerAdapter';
import { LoggerController } from './Controllers/LoggerController';
function defaultLogger() {
const adapter = new WinstonLoggerAdapter({
logsFolder: defaults.logsFolder,
jsonLogs: defaults.jsonLogs,
verbose: defaults.verbose,
silent: defaults.silent });
return new LoggerController(adapter);
}
let logger = defaultLogger();
export function setLogger(aLogger) {
logger = aLogger;
}
export function getLogger() {
return logger;
}
// for: `import logger from './logger'`
Object.defineProperty(module.exports, 'default', {
get: getLogger
});
// for: `import { logger } from './logger'`
Object.defineProperty(module.exports, 'logger', {
get: getLogger
});