Skip to content

Better logging control #374

@stestoll

Description

@stestoll

Currently, logging levels for some of the EasySpin functions are set via Opt.Verbosity with numerical levels 0 through 4. Logging is done by calling the private function logmsg. Here are several partially connected proposals

  1. Logging could be elevated to a user-accessible function, say eslogger that can be called independently to set the log level EasySpin-wide. The legacy Opt.Verbosity could remain supported for now, or eliminated. Calling eslogger would return the currently set log level.

    eslogger(2);   % set log level
    pepper(...)   % pepper uses log level 2
    eslogger    % returns 2

    This would eliminate the need to implement log level setting interfaces separately for each EasySpin function. The log level setting would persist between EasySpin function calls. Many more EasySpin functions could support logging without needing their own interface.

  2. The log levels could be named: 0 = 'off', 1 = 'info', 2 = 'detail', 3 = 'debug', 4 = 'trace'.

    eslogger detail  % = 2
    eslogger('off')  % = 0
    Opt.Verbosity = 'trace';  % = 4
  3. Opt.Verbosity could be renamed to Opt.PrintLevel or similar (if not eliminated).

  4. eslogger could be extended to include writing to a file, cashing all log messages, calling handler function to redirect the output to GUI, etc.

  5. Maybe errors and in particular warnings can be incorporated into this as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions