-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
tools: add logfmt option for frr-reload.py #16796
base: master
Are you sure you want to change the base?
Conversation
dcec885
to
a5f4cac
Compare
What is the real case it would be helpful? |
This is useful for integrating with observability stacks, as logfmt is a common format for machine-readable logs. It enhances log parsing and visualization in tools like Prometheus and Grafana. We might consider using the logfmter library for a more standardized implementation. If we prefer using the library, I'll be happy to replace my implementation with that. |
IMO it's better without 3rd party libraries in this place as it might complicate things (installing). Two bullets to solve still regarding this PR:
|
a5f4cac
to
52f409f
Compare
ci:rerun CI stuck |
52f409f
to
b5a02ac
Compare
e1028db
to
4f5a152
Compare
Adopt f-string for printing log message, so that appropriate formatting can be applied. Signed-off-by: Giovanni Tataranni <[email protected]>
Add the option of printing logs in logfmt format. Additional machine readable information can be printed via the `extra` argument. Example: ```python log.debug("exit context"), extra={"line": line, "ctx_keys": ctx_keys}) log.error(f"Failed to execute command {' '.join(cmd)}", extra={"cmd": cmd}) ``` Signed-off-by: Giovanni Tataranni <[email protected]>
4f5a152
to
7ae71ae
Compare
@ton31337 Changes done, please review |
Add the option of printing logs in logfmt format.
Adopt f-string for printing log message, so that appropriate formatting can be applied.
Additional machine readable information can be printed via the
extra
argument.Example: