@monitorss/logger
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -53,4 +53,8 @@ interface Config { | ||
error: (message: string, meta?: Record<string, any> | undefined) => void; | ||
/** | ||
* When we only want to send data to Datadog. | ||
*/ | ||
datadog: (message: string, meta?: Record<string, any> | undefined) => void; | ||
}; | ||
export declare type MonitoLogger = ReturnType<typeof setupLogger>; | ||
export default setupLogger; |
@@ -30,2 +30,6 @@ "use strict"; | ||
error: createArrayLoggers('error', loggers.error), | ||
/** | ||
* When we only want to send data to Datadog. | ||
*/ | ||
datadog: createArrayLoggers('info', loggers.datadog), | ||
}; | ||
@@ -48,2 +52,3 @@ }; | ||
]; | ||
const datadogTransports = []; | ||
if (config.datadog) { | ||
@@ -59,2 +64,3 @@ const datadogLogger = new DatadogLogger_1.default({ | ||
errorTransports.push(datadogLogger); | ||
datadogTransports.push(datadogLogger); | ||
} | ||
@@ -66,2 +72,3 @@ const logger = setLoggingTransports({ | ||
error: errorTransports, | ||
datadog: datadogTransports, | ||
}); | ||
@@ -68,0 +75,0 @@ return logger; |
@@ -6,4 +6,16 @@ # Change Log | ||
# [1.1.0](https://github.com/MonitoRSS/typescript-template/compare/@monitorss/logger@1.0.1...@monitorss/logger@1.1.0) (2022-01-05) | ||
### Features | ||
* **logger:** Add datadog logger level ([8dab1ff](https://github.com/MonitoRSS/typescript-template/commit/8dab1ff06eeaff6e5de27ec8934abc8c7d3b5e38)) | ||
## 1.0.1 (2021-12-02) | ||
**Note:** Version bump only for package @monitorss/logger |
{ | ||
"name": "@monitorss/logger", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "", | ||
@@ -42,3 +42,4 @@ "main": "build/index.js", | ||
"winston": "^3.3.3" | ||
} | ||
}, | ||
"gitHead": "da95ad12b6a56148ad835ae52df8ccfc96bfd235" | ||
} |
@@ -13,2 +13,3 @@ import ConsoleJSONLogger from './ConsoleJSONLogger'; | ||
error: LoggerType[] | ||
datadog: LoggerType[] | ||
} | ||
@@ -46,2 +47,6 @@ | ||
error: createArrayLoggers('error', loggers.error), | ||
/** | ||
* When we only want to send data to Datadog. | ||
*/ | ||
datadog: createArrayLoggers('info', loggers.datadog), | ||
}; | ||
@@ -103,2 +108,3 @@ }; | ||
]; | ||
const datadogTransports: LoggerType[] = []; | ||
@@ -115,2 +121,3 @@ if (config.datadog) { | ||
errorTransports.push(datadogLogger); | ||
datadogTransports.push(datadogLogger); | ||
} | ||
@@ -123,2 +130,3 @@ | ||
error: errorTransports, | ||
datadog: datadogTransports, | ||
}); | ||
@@ -125,0 +133,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
35673
718