Skip to content

Commit

Permalink
Tweak approved by ATM
Browse files Browse the repository at this point in the history
  • Loading branch information
lbwexler committed Oct 14, 2024
1 parent f56efb7 commit 43a568e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/groovy/io/xh/hoist/log/LogSupport.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,9 @@ trait LogSupport {
private <T> T loggedDo(Logger log, Level level, Object msgs, Closure<T> c) {
Map meta = getMeta() ?: [:];

// Log *start* of closure execution if logging enabled @ one level finer than the main log level.
// Ie setting level to debug will start showing INFO start msgs, up to trace to show DEBUG start msgs.
if (
(level == INFO && log.debugEnabled) || (level == DEBUG && log.traceEnabled) || level == TRACE
) {
// Log *start* of closure execution if at a fine run-time level. Use debug to get
// start msgs for your 'withInfo' logs, trace for your 'withDebug/withTrace'
if ((log.debugEnabled && level == INFO) || log.traceEnabled) {
meta << [_status: 'started']
logAtLevel(log, level, msgs, meta)
}
Expand Down

0 comments on commit 43a568e

Please sign in to comment.