Skip to content

Commit 4dd3cee

Browse files
core: frontend: libs: Fix log schema not being applied
withSchema returns a new Encoding (it does not mutate), so the schema must be captured here
1 parent 637d3f9 commit 4dd3cee

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

core/frontend/src/libs/console-logger.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ class ConsoleLogger {
3434

3535
private static readonly STACK_LINE_REGEX = /\(?([^\s()]+):(\d+):\d+\)?/
3636

37-
private static readonly LOG_ENCODING = Encoding.from_string(Encoding.APPLICATION_JSON.toString())
37+
private static readonly LOG_ENCODING = Encoding.fromString(
38+
Encoding.APPLICATION_JSON.toString(),
39+
).withSchema('foxglove.Log')
3840

3941
readonly originalConsole: {
4042
log: typeof console.log
@@ -52,8 +54,6 @@ class ConsoleLogger {
5254
error: console.error,
5355
debug: console.debug,
5456
}
55-
56-
ConsoleLogger.LOG_ENCODING.with_schema('foxglove.Log')
5757
}
5858

5959
async initialize(): Promise<void> {

0 commit comments

Comments
 (0)