Skip to content

Commit 9415b08

Browse files
committedNov 22, 2016
Update google-cloud dependency
Provides official API for setting timestamp and severity.
1 parent e9b056f commit 9415b08

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed
 

‎lib/bunyan-stackdriver.js

+6-5
Original file line numberDiff line numberDiff line change
@@ -93,12 +93,13 @@ BunyanStackDriver.prototype._write = function write(record, encoding, callback)
9393
record = destroyCircular(record);
9494
strictJSON(record);
9595

96-
var entry = this.log.entry(this.resource, record);
96+
var metadata = {
97+
resource: this.resource,
98+
timestamp: timestamp,
99+
severity: mapLevelToSeverity[nameFromLevel[record.level]] || 'DEFAULT'
100+
};
97101

98-
// There are no public APIs for this yet:
99-
// https://github.com/GoogleCloudPlatform/gcloud-node/issues/1348
100-
entry.timestamp = timestamp;
101-
entry.severity = mapLevelToSeverity[nameFromLevel[record.level]] || 'DEFAULT';
102+
var entry = this.log.entry(metadata, record);
102103

103104
this.entryQueue.push(entry);
104105

‎package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "bunyan-stackdriver",
3-
"version": "1.2.1",
3+
"version": "1.2.2",
44
"description": "StackDriver stream for Bunyan",
55
"main": "./lib/bunyan-stackdriver",
66
"repository": {
@@ -21,7 +21,7 @@
2121
},
2222
"homepage": "https://github.com/mlazarov/bunyan-stackdriver",
2323
"dependencies": {
24-
"@google-cloud/logging": "^0.1.1",
24+
"@google-cloud/logging": "^0.5.0",
2525
"destroy-circular": "^1.1.0"
2626
},
2727
"devDependencies": {

0 commit comments

Comments
 (0)
Failed to load comments.