Skip to content

stdlib_logger: proposition to add a logger for debug phases and levels among the different logs #254

Closed
@jvdp1

Description

@jvdp1

I am playing with stdlib_logger and I think it would be nice to have a subroutine for messages that should be printed only during debug phases.

Proposition

log_debug - Writes the string message to self % log_units

Syntax

call self % log_debug( message [,module, procedure, stat, errmsg] )

Log levels

Log levels are used for filtering the messages based on their level/severity.
Each subroutine log_error, log_information, log_io_error, log_text_error, log_warning, and the additional log_debug is associated with a level.

For example:

  • log_debug associated with debug_level
  • log_information associated with information_level
  • log_warning associated with warning_level
  • log_error, log_io_error, log_text_error associated with error_level

with debug_level < information_level < warning_level < error_level.

Since log_message is called by all other log subroutines, it is probably best to not assign a level to log_message IMO.

The level of the logger should be set with the method configure, e.g. call self %configure( level = information_level), meaning that all calls with a level < information_level would be ignored.

Such log level options are avaible in Julia or Python loggers.

@wclodius2 , @milancurcic , @14NGiestas , @ivan-pi , @certik is that of interests? any thoughs, comments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: IOCommon input/output related features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions