-
Notifications
You must be signed in to change notification settings - Fork 6
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
feat: Add log level config option to SDK #315
Conversation
@@ -33,32 +33,48 @@ export const FAILED_AUTH_FOR_LOCAL_VISUALIZATIONS = | |||
); | |||
|
|||
export const validateOptionsWarnings = (options?: HoneycombOptions) => { | |||
const logLevel = options?.logLevel |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Q for this change: Are there any other areas we'd like to see the logs being controlled?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we search for console.*
Looks like there's some statements in packages/honeycomb-opentelemetry-web/src/console-trace-link-exporter.ts
.
We might need to tweak the API for ConsoleTraceLinkExporter
to accept the full options
object rather than just the service name.
constructor(serviceName?: string, apikey?: string) { | ||
if (!serviceName || !apikey) { | ||
console.debug(MISSING_FIELDS_FOR_LOCAL_VISUALIZATIONS); | ||
this._logLevel >= DiagLogLevel.DEBUG && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this into a nested if clause so that it's explicit. Fall through side effects can be difficult to reason over.
Which problem is this PR solving?
Short description of the changes
Users will now have the option to set a log level when initializing the SDK. This log level controls the verbosity of logs outputted. The current log levels includes DEBUG, INFO, WARN, and ERROR.
How to verify that this has the expected result