-
-
Notifications
You must be signed in to change notification settings - Fork 150
Feature logger component #1013
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
base: main
Are you sure you want to change the base?
Feature logger component #1013
Conversation
…l case insensitive
…method log::Level::from_str()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good, I'm in line with the general approach ! I made a few comments below.
src/render.rs
Outdated
if let Some(value) = object_map.get(LOG_MESSAGE_KEY) { | ||
log::log!(target: LOG_TARGET, log_level, "{value}"); | ||
} else { | ||
return Err(anyhow::anyhow!("no message was defined for log component")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the log message should explicitly state where it comes from.
Something like :
log message from test.sql, statement 6: Hello World
You can use current_statement, and the request_context
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I now added source_path from ParsedSqlFile to RequestContext. i had to change the visibility to pub instead of pub(crate) though. Did you have a different way in mind when telling me to use request_context?
Good; I'll refactor to avoid the duplication and cloning between RequestInfo and RequestContext, but this is out of scope for this pr. I think all that is missing before we can merge is
|
Another thing that would be nice is for the log component to work while in header context. Currently logging something switches to html rendering, which means you can't log anything before the shell. |
where can i define or search for a icon the component should get? |
I have implemented the logger component based on the Idea #985, with the small change of renaming "output" to "message".
It is not documented yet, since i am still trying to wrap my head around the documentation, but i wanted to know what you think, before committing any further.