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

perf: write out log line with time-prefix as one string to avoid holding locks #40

Merged
merged 1 commit into from
Feb 9, 2024
Merged

perf: write out log line with time-prefix as one string to avoid holding locks #40

merged 1 commit into from
Feb 9, 2024

Conversation

mk-fg
Copy link
Contributor

@mk-fg mk-fg commented Feb 9, 2024

Earlier implementation in #35 can loop while holding the lock, which is not a good idea, and composing prefix+line into one GString is simpler anyway.
Using glib datetime and string formatting also allows to simplify implementation.

…ing locks

Earlier implementation in #35 can loop while holding the lock, which is not
a good idea, and composing prefix+line into one GString is simpler anyway.
Using glib datetime and string formatting also allows to simplify implementation.
@mergify mergify bot merged commit bf3ffce into metwork-framework:master Feb 9, 2024
2 checks passed
@thebaptiste
Copy link
Contributor

Thanks again !

Is ok for you, no more important PR left at hand ?

I have release 0.6.0 with your two first PR and my ugly fix, I intend to release 0.7.0 now.

@mk-fg
Copy link
Contributor Author

mk-fg commented Feb 9, 2024

Yeah, nothing else actually useful. Thanks.

@mk-fg
Copy link
Contributor Author

mk-fg commented Feb 9, 2024

Or actually one thing that maybe bothers me is that while glib funcs handle all errors for e.g. invalid strftime string, it ends up being not-specific "prefix is NULL", which should probably be handled with a special more descriptive message, like "problem with strftime on %s" removed here did.

mergify bot pushed a commit that referenced this pull request Feb 9, 2024
…-prefix (#41)

Sorry for not thinking of it in #40, but this should fix non-descriptive something-about-assert-NULL error for bad timestamp-prefix format to something like this:
```
(log_proxy:269749): log_proxy-CRITICAL **: 17:37:58.678: strftime failed for timestamp-prefix: %
```
A relatively minor fix, I think.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants