Conversation
size-limit report 📦
|
|
| expect(debugCalls).toHaveLength(1); | ||
| const [level, msg, ctx] = debugCalls[0]; | ||
| expect(level).toBe(LogLevel.debug); | ||
| expect(msg).toBe('[room=foo participant=alice] hello world'); |
There was a problem hiding this comment.
This is sweet! That being said, should there be a way to turn the prefix on or off? In particular, I'm thinking that if people were capturing these logs with a tool like datadog / ELK, they'd have the rich metadata and it would get annoying maybe to see it duplicated again in the log message.
| * suitable for prepending to a log message. Returns an empty string when | ||
| * no display keys are present. Pure function — safe to unit test directly. | ||
| */ | ||
| export function formatDisplayContext(ctx: object | undefined): string { |
There was a problem hiding this comment.
suggestion: Could it be possible to make ctx something like Partial<Record<keyof typeof DISPLAY_KEYS, unknown>> (probably broken out into a type though and not inline, and also using this in ContextProvider?). If this were done everywhere that would make the typing information a bit more robust.
| - **debug** — everything else: individual signal messages, per-ICE- | ||
| candidate, SDP, DTX/simulcast/codec negotiation, data channel | ||
| lifecycle, reconnection internal states, timing details. | ||
| - **trace** — reserved for deliberate deep dives; unused by default. |
There was a problem hiding this comment.
nitpick: It might be worth mentioning here what you told me in our 1:1 that loglevel's trace logs include stack traces, and that's the main reason this level isn't being used more extensively.
No description provided.