@autofleet/logger 4.0.0-beta-3 → 4.0.0-beta-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/dist/index.js +3 -12
- package/package.json +1 -1
- package/tsconfig.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,29 +30,20 @@ const getLevel = (logLevel) => {
|
|
|
30
30
|
const createLoggerInstance = (level, options) => {
|
|
31
31
|
let loggerInstance;
|
|
32
32
|
if (process.env.NODE_ENV === 'production') {
|
|
33
|
-
loggerInstance = (0, pino_1.default)((0, pino_cloud_logging_1.gcpLogOptions)({
|
|
34
|
-
level: process.env.PINO_LOG_LEVEL || 'info',
|
|
35
|
-
...options,
|
|
36
|
-
}));
|
|
33
|
+
loggerInstance = (0, pino_1.default)((0, pino_cloud_logging_1.gcpLogOptions)(Object.assign({ level: process.env.PINO_LOG_LEVEL || 'info' }, options)));
|
|
37
34
|
}
|
|
38
35
|
else {
|
|
39
|
-
loggerInstance = (0, pino_1.default)({
|
|
40
|
-
level: process.env.PINO_LOG_LEVEL || 'info',
|
|
41
|
-
transport: {
|
|
36
|
+
loggerInstance = (0, pino_1.default)(Object.assign({ level: process.env.PINO_LOG_LEVEL || 'info', transport: {
|
|
42
37
|
target: 'pino-pretty',
|
|
43
38
|
options: {
|
|
44
39
|
colorize: true,
|
|
45
40
|
},
|
|
46
|
-
},
|
|
47
|
-
...options,
|
|
48
|
-
});
|
|
41
|
+
} }, options));
|
|
49
42
|
}
|
|
50
43
|
loggerInstance.level = level;
|
|
51
44
|
return loggerInstance;
|
|
52
45
|
};
|
|
53
46
|
class LoggerInstanceManager {
|
|
54
|
-
contextMiddlewares;
|
|
55
|
-
logger;
|
|
56
47
|
constructor(logLevel) {
|
|
57
48
|
this.contextMiddlewares = [];
|
|
58
49
|
this.logger = createLoggerInstance(getLevel(logLevel), {
|
package/package.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"target": "
|
|
3
|
+
"target": "ES6", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
|
4
4
|
"module": "commonjs", /* Specify what module code is generated. */ /* Allow 'import x from y' when a module doesn't have a default export. */
|
|
5
5
|
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
|
6
6
|
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|