-
Notifications
You must be signed in to change notification settings - Fork 28
Description
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
-
Logging could be elevated to a user-accessible function, say
esloggerthat can be called independently to set the log level EasySpin-wide. The legacyOpt.Verbositycould remain supported for now, or eliminated. Callingesloggerwould 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.
-
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
-
Opt.Verbositycould be renamed toOpt.PrintLevelor similar (if not eliminated). -
esloggercould be extended to include writing to a file, cashing all log messages, calling handler function to redirect the output to GUI, etc. -
Maybe errors and in particular warnings can be incorporated into this as well.