@timberio/core
Advanced tools
Comparing version 0.16.0 to 0.17.0
@@ -85,4 +85,11 @@ "use strict"; | ||
// Build the initial log | ||
const initialLog = Object.assign({ dt: new Date(), level, | ||
message }, log); | ||
const initialLog = Object.assign({ | ||
// Implicit date timestamp | ||
dt: new Date() }, log, { | ||
// Explicit level | ||
level, | ||
// Explicit message | ||
message, | ||
// Finally, add the definitive schema | ||
$schema: "https://raw.githubusercontent.com/timberio/log-event-json-schema/v4.1.0/schema.json" }); | ||
// Pass the log through the middleware pipeline | ||
@@ -89,0 +96,0 @@ const transformedLog = await this._middleware.reduceRight((fn, pipedLog) => fn.then(pipedLog), Promise.resolve(initialLog)); |
@@ -19,3 +19,3 @@ "use strict"; | ||
}); | ||
it("should use the preProcess pipeline", async () => { | ||
it("should add an implicit `dt` timestamp", async () => { | ||
// Fixtures | ||
@@ -22,0 +22,0 @@ const message = "Test"; |
@@ -83,4 +83,11 @@ import { LogLevel } from "@timberio/types"; | ||
// Build the initial log | ||
const initialLog = Object.assign({ dt: new Date(), level, | ||
message }, log); | ||
const initialLog = Object.assign({ | ||
// Implicit date timestamp | ||
dt: new Date() }, log, { | ||
// Explicit level | ||
level, | ||
// Explicit message | ||
message, | ||
// Finally, add the definitive schema | ||
$schema: "https://raw.githubusercontent.com/timberio/log-event-json-schema/v4.1.0/schema.json" }); | ||
// Pass the log through the middleware pipeline | ||
@@ -87,0 +94,0 @@ const transformedLog = await this._middleware.reduceRight((fn, pipedLog) => fn.then(pipedLog), Promise.resolve(initialLog)); |
@@ -14,3 +14,3 @@ import Base from "./base"; | ||
}); | ||
it("should use the preProcess pipeline", async () => { | ||
it("should add an implicit `dt` timestamp", async () => { | ||
// Fixtures | ||
@@ -17,0 +17,0 @@ const message = "Test"; |
{ | ||
"name": "@timberio/core", | ||
"version": "0.16.0", | ||
"version": "0.17.0", | ||
"description": "Timber.io - logging core", | ||
@@ -40,6 +40,6 @@ "keywords": [ | ||
"dependencies": { | ||
"@timberio/tools": "^0.16.0", | ||
"@timberio/types": "^0.16.0" | ||
"@timberio/tools": "^0.17.0", | ||
"@timberio/types": "^0.17.0" | ||
}, | ||
"gitHead": "13fe691283afc3d96d5bc1ff7b13173f55389621" | ||
"gitHead": "4e067b488fd87e43621d053b58e665bf55632bd8" | ||
} |
@@ -19,3 +19,3 @@ import Base from "./base"; | ||
it("should use the preProcess pipeline", async () => { | ||
it("should add an implicit `dt` timestamp", async () => { | ||
// Fixtures | ||
@@ -22,0 +22,0 @@ const message = "Test"; |
@@ -129,6 +129,17 @@ import { | ||
const initialLog: ITimberLog = { | ||
// Implicit date timestamp | ||
dt: new Date(), | ||
// Overwrite defaults / add context, with `log` object | ||
...log, | ||
// Explicit level | ||
level, | ||
// Explicit message | ||
message, | ||
...log | ||
// Finally, add the definitive schema | ||
$schema: | ||
"https://raw.githubusercontent.com/timberio/log-event-json-schema/v4.1.0/schema.json" | ||
}; | ||
@@ -135,0 +146,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
68139
1324
+ Added@timberio/tools@0.17.0(transitive)
+ Added@timberio/types@0.17.0(transitive)
- Removed@timberio/tools@0.16.0(transitive)
- Removed@timberio/types@0.16.0(transitive)
Updated@timberio/tools@^0.17.0
Updated@timberio/types@^0.17.0