-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
[browser logging] allow to configure root level #176397
Changes from all commits
5bc0ee7
77c227f
dec96f7
bef78be
c06138a
2455b82
3e7ba81
0a643f4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,12 +133,9 @@ export class AnalyticsClient implements IAnalyticsClient { | |
properties: eventData as unknown as Record<string, unknown>, | ||
}; | ||
|
||
// debug-logging before checking the opt-in status to help during development | ||
if (this.initContext.isDev) { | ||
this.initContext.logger.debug<EventDebugLogMeta>(`Report event "${eventType}"`, { | ||
ebt_event: event, | ||
}); | ||
} | ||
this.initContext.logger.debug<EventDebugLogMeta>(`Report event "${eventType}"`, { | ||
ebt_event: event, | ||
}); | ||
Comment on lines
+136
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No longer needs this There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. then again https://xkcd.com/1172 |
||
|
||
const optInConfig = this.optInConfig$.value; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0 and the Server Side Public License, v 1; you may not use this file except | ||
* in compliance with, at your election, the Elastic License 2.0 or the Server | ||
* Side Public License, v 1. | ||
*/ | ||
|
||
import type { LogLevelId } from '@kbn/logging'; | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export interface BrowserLoggingConfig { | ||
root: BrowserRootLoggerConfig; | ||
} | ||
|
||
/** | ||
* @internal | ||
*/ | ||
export interface BrowserRootLoggerConfig { | ||
level: LogLevelId; | ||
} | ||
Comment on lines
+11
to
+23
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Base types for the browser-side logging config. It's simplistic right now, but more fields should appear when we go further on #144276 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,6 +47,12 @@ export const loggerSchema = schema.object({ | |
level: levelSchema, | ||
}); | ||
|
||
const browserConfig = schema.object({ | ||
root: schema.object({ | ||
level: levelSchema, | ||
}), | ||
}); | ||
|
||
export const config = { | ||
path: 'logging', | ||
schema: schema.object({ | ||
|
@@ -63,6 +69,7 @@ export const config = { | |
}), | ||
level: levelSchema, | ||
}), | ||
browser: browserConfig, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm exposing the browser logging configuration via the I wasn't sure, but in the end I still think it makes sense to have a single prefix (and that it isn't worth introducing heavy changes to move the server-side logging under the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It would be nice to have them symmetrical, but I think |
||
}), | ||
}; | ||
|
||
|
@@ -71,6 +78,10 @@ export type LoggingConfigType = Pick<TypeOf<typeof config.schema>, 'loggers' | ' | |
appenders: Map<string, AppenderConfigType>; | ||
}; | ||
|
||
/** @internal */ | ||
export type LoggingConfigWithBrowserType = LoggingConfigType & | ||
Pick<TypeOf<typeof config.schema>, 'browser'>; | ||
|
||
/** | ||
* Config schema for validating the inputs to the {@link LoggingServiceStart.configure} API. | ||
* See {@link LoggerContextConfigType}. | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Not sure it was really needed given right now it's mostly for internal/development usage, but I still added a snippet in the config file.