-
Notifications
You must be signed in to change notification settings - Fork 7
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 support for defining maximum log level #72
Conversation
log-base/src/Log/Data.hs
Outdated
@@ -40,6 +41,9 @@ showLogLevel LogAttention = "attention" | |||
showLogLevel LogInfo = "info" | |||
showLogLevel LogTrace = "trace" | |||
|
|||
defaultLogLevel :: LogLevel | |||
defaultLogLevel = LogTrace |
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.
Should probably be LogInfo
.
log-base/src/Log/Logger.hs
Outdated
@@ -32,6 +32,7 @@ data LoggerEnv = LoggerEnv | |||
, leDomain :: ![T.Text] -- ^ Current application domain. | |||
, leData :: ![A.Pair] -- ^ Additional data to be merged with the log | |||
-- message\'s data. | |||
, leMaxLogLevel :: LogLevel -- ^ The maximum log level to be logged. |
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.
To make things very clear that it's the maximum (not minimum) allowed level, we should probably add a note to where LogLevel
is defined and explicitly mention that it derives Ord
. And the order in which the constructors are defined then implies which one is actually of "the highest value" and also the most verbose.
158c1fc
to
2d90447
Compare
@@ -40,6 +44,9 @@ showLogLevel LogAttention = "attention" | |||
showLogLevel LogInfo = "info" | |||
showLogLevel LogTrace = "trace" | |||
|
|||
defaultLogLevel :: 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.
You can add a haddock comment that it's LogInfo.
No description provided.