Skip to content

Commit

Permalink
Fixed logger.
Browse files Browse the repository at this point in the history
  • Loading branch information
interkosmos committed Apr 11, 2024
1 parent af35fc2 commit ac79ac5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/dm_logger.f90
Original file line number Diff line number Diff line change
Expand Up @@ -201,22 +201,21 @@ subroutine logger_log_args(this, level, message, source, observ, timestamp, erro
logical, intent(in), optional :: verbose !! Create log if `error` is passed and `E_NONE` (`.false.` by default).

logical :: escape_, verbose_
integer :: error_
type(log_type) :: log

error_ = E_NONE
escape_ = .true.
verbose_ = .false.

if (present(error)) error_ = error
if (present(escape)) escape_ = escape
if (present(verbose)) verbose_ = verbose

! Ignore debugging messages if forwarding and output are both disabled.
if (level == LVL_DEBUG .and. this%min_level > LVL_DEBUG .and. .not. this%verbose) return

! Ignore error code `E_NONE` if not verbose.
if (dm_is_ok(error_) .and. .not. verbose_) return
if (present(error)) then
if (dm_is_ok(error) .and. .not. verbose_) return
end if

! Replace invalid log level with `LVL_ERROR`.
log%level = LVL_ERROR
Expand Down

0 comments on commit ac79ac5

Please sign in to comment.