-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Logging Bunyan Typescript Migration #15
Logging Bunyan Typescript Migration #15
Conversation
gaofanmichael
commented
Nov 27, 2017
- Tests and linter pass
- Tests/sample tests/system tests all migrated.
@@ -8,7 +8,7 @@ | |||
"node": ">=4.0.0" | |||
}, | |||
"repository": "googleapis/nodejs-logging-bunyan", | |||
"main": "./src/index.js", | |||
"main": "./build/src/index.js", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -8,7 +8,7 @@ | |||
"node": ">=4.0.0" | |||
}, | |||
"repository": "googleapis/nodejs-logging-bunyan", | |||
"main": "./src/index.js", | |||
"main": "./build/src/index.js", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
package.json
Outdated
"extend": "^3.0.1" | ||
"@types/bunyan": "^1.8.3", | ||
"extend": "^3.0.1", | ||
"stream": "0.0.2", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
package.json
Outdated
"@types/bunyan": "^1.8.3", | ||
"extend": "^3.0.1", | ||
"stream": "0.0.2", | ||
"typescript": "^2.6.1" |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
import * as util from 'util'; | ||
import {Writable} from 'stream'; | ||
const logging = require('@google-cloud/logging'); | ||
// var Writable = require('stream').Writable; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
* | ||
* @private | ||
*/ | ||
_write(record: BunyanLogRecord, encoding?: string, callback?: Function) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
}>, | ||
callback?: Function) { | ||
// tslint:disable-next-line:no-any | ||
const entries = chunks.map((request: any) => { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
system-test/logging-bunyan.ts
Outdated
* limitations under the License. | ||
*/ | ||
|
||
'use strict'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
test/index.ts
Outdated
* limitations under the License. | ||
*/ | ||
import * as assert from 'assert'; | ||
import * as extend from 'extend'; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
tsconfig.json
Outdated
"outDir": "build", | ||
"skipLibCheck": true, | ||
"noStrictGenericChecks": true, | ||
"strictFunctionTypes": false |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
import * as extend from 'extend'; | ||
import * as util from 'util'; | ||
import {Writable} from 'stream'; | ||
const logging = require('@google-cloud/logging'); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
// var Writable = require('stream').Writable; | ||
|
||
// Map of Stackdriver logging levels. | ||
const BUNYAN_TO_STACKDRIVER: {[key: number]: string} = { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
@@ -0,0 +1,257 @@ | |||
/*! |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
private stackdriverLog: | ||
StackdriverLog; // TODO: add type for @google-cloud/logging | ||
constructor(options: Options) { | ||
if (new.target !== LoggingBunyan) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
} | ||
|
||
/** | ||
* @param {string|number} level A bunyan logging level. Log entries at or |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
* | ||
* @param {object} record - Bunyan log record. | ||
* | ||
* @private |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
src/index.ts
Outdated
*/ | ||
// Writable.write used 'any' in function signature. | ||
// tslint:disable-next-line:no-any | ||
write(record: any, callback?: Function): boolean; |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
340573a
to
17b51d2
Compare
17b51d2
to
2a1e324
Compare
package.json
Outdated
@@ -8,9 +8,11 @@ | |||
"node": ">=4.0.0" | |||
}, | |||
"repository": "googleapis/nodejs-logging-bunyan", | |||
"main": "./src/index.js", | |||
"main": "./build/src/index.js", | |||
"types": "./build/src/index.d.ts", | |||
"files": [ | |||
"src", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
b902924
to
abf790b
Compare