-
Notifications
You must be signed in to change notification settings - Fork 38
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
Add set_logger_level function #80
Conversation
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.
Nice idea, thank you.
src/wisp.gleam
Outdated
/// [1]: https://www.erlang.org/doc/man/logger | ||
/// | ||
pub type LogLevel = | ||
logging.LogLevel |
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.
Could you create a new custom type here for the log level? To avoid making that library part of the public API, and to avoid the users having to import 2 modules.
src/wisp.gleam
Outdated
/// | ||
/// [1]: https://www.erlang.org/doc/man/logger | ||
/// | ||
pub fn set_logger_level(log_level: LogLevel) { |
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.
The return annotation is missing!
Comments solved! |
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.
Thank you! Would you mind updating the changelog also
Done! |
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.
Thank you!!
src/wisp.gleam
Outdated
Emergency | ||
Alert | ||
Critical | ||
Error |
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.
Ah! This is overriding the prelude Error type resulting in type errors. Perhaps they can all be suffixed with Level
?
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.
Uuhh my lsp didn't caught that, my bad!
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.
Done!
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.
Lovely!!! Thank you!
As I've noticed the logging library has been updated with the new set_logger_level function. I've thought that adding a wrapper around that function in wisp would be nice, altough it could be divided into many smaller functions as set_log_level_to_info() and the like. What do you think?