-
Notifications
You must be signed in to change notification settings - Fork 98
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
Removed dependency on cloud-diagnostics-common #338
Conversation
@@ -125,7 +126,18 @@ var publicAgent = { | |||
if (!config.enabled) { | |||
return this; | |||
} | |||
var logger = common.logger.create(config.logLevel, '@google/cloud-trace'); | |||
|
|||
var logLevel = config.logLevel || 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.
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.
var logger = common.logger.create(config.logLevel, '@google/cloud-trace'); | ||
|
||
var logLevel = config.logLevel || 2; | ||
if (logLevel < 0) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
var logLevel = config.logLevel || 2; | ||
if (logLevel < 0) { | ||
logLevel = 0; | ||
} else if (logLevel > 4) { |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Addressed inconsistencies in log levels here: googleapis/google-cloud-node#1900 |
try { | ||
config.logLevel = parseInt(process.env.GCLOUD_TRACE_LOGLEVEL); | ||
} catch (e) { | ||
// Just use the original log level if GCLOUD_TRACE_LOGLEVEL is malformed. |
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.
util._extend(config, projectConfig); | ||
if (process.env.hasOwnProperty('GCLOUD_TRACE_LOGLEVEL')) { | ||
if (process.env.GCLOUD_TRACE_LOGLEVEL.match(/^\d+$/)) { | ||
config.logLevel = parseInt(process.env.GCLOUD_TRACE_LOGLEVEL); |
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.
util._extend(config, require('./config.js').trace); | ||
util._extend(config, projectConfig); | ||
if (process.env.hasOwnProperty('GCLOUD_TRACE_LOGLEVEL')) { | ||
if (process.env.GCLOUD_TRACE_LOGLEVEL.match(/^\d+$/)) { |
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.
if (!logLevelValid) { | ||
var desiredLogLevel = process.env.GCLOUD_TRACE_LOGLEVEL || | ||
config.logLevel; | ||
logger.warn('Provided log level ' + desiredLogLevel + ' is invalid, ' + |
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.
// The contents of a key file. If this field is set, its contents will be | ||
// used for authentication instead of your application default credentials. | ||
credentials: null, | ||
|
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.
Removed all dependencies on cloud-diagnostics-common, replacing with equivalent functionality in cloud-common.