Skip to content
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(trace): scoped logging #230

Closed
wants to merge 9 commits into from
Closed

feat(trace): scoped logging #230

wants to merge 9 commits into from

Conversation

dadepo
Copy link
Contributor

@dadepo dadepo commented Aug 19, 2024

Closes #150

Output of the test

zig build test -Dfilter="trace.logger: works"
test
└─ run test stderr
-- Initial log entry not scoped
time=2024-08-22T05:22:43Z level=info  Not scoped
-- Scoped log entry
[trace.log] time=2024-08-22T05:22:43Z level=debug elapsed=4245  request with id abcd1234 succeeded
[trace.log] time=2024-08-22T05:22:43Z level=info kind=some_enum_kind  operation was done
[trace.log] time=2024-08-22T05:22:43Z level=warning authorized=false  api call received at 10004 not authorized
[trace.log] time=2024-08-22T05:22:43Z level=error error="IOError"  api call received at 10005 broke the system!
[trace.log] time=2024-08-22T05:22:43Z level=debug elapsed=4245  request with id succeeded
[trace.log] time=2024-08-22T05:22:43Z level=info kind=some_enum_kind  operation was done
[trace.log] time=2024-08-22T05:22:43Z level=warning authorized=false  api call received at not authorized
[trace.log] time=2024-08-22T05:22:43Z level=error error="IOError"  api call received broke the system!
[trace.log] time=2024-08-22T05:22:43Z level=info tmp1=123 tmp2=456 tmp2="t12312"  new push message
[trace.log] time=2024-08-22T05:22:43Z level=info  new push message
[trace.log] time=2024-08-22T05:22:43Z level=info  operation was done
[trace.log] time=2024-08-22T05:22:43Z level=warning  api call received at 10004 not authorized
[trace.log] time=2024-08-22T05:22:43Z level=error  api call received at 10005 broke the system!
[trace.log] time=2024-08-22T05:22:43Z level=debug  request with id succeeded
[trace.log] time=2024-08-22T05:22:43Z level=info  operation was done
[trace.log] time=2024-08-22T05:22:43Z level=warning  api call received at not authorized
[trace.log] time=2024-08-22T05:22:43Z level=error  api call received broke the system!
-- Scope changed.
[trace.entry.StandardEntry] time=2024-08-22T05:22:43Z level=info  Scope Changed

@dadepo dadepo marked this pull request as ready for review August 19, 2024 18:35
@0xNineteen 0xNineteen changed the title feat(trace) Scoped logging feat(trace): scoped logging Aug 24, 2024
@0xNineteen
Copy link
Contributor

closing this since progress seems to have moved to #249

@0xNineteen 0xNineteen closed this Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logger: Scoped logging
2 participants