Message Levels
Message levels in SciMLLogging determine the severity and importance of log messages. Understanding these levels is essential for configuring appropriate verbosity in your applications.
Overview
SciMLLogging defines a single concrete MessageLevel type (backed by an integer) that represents the severity of a log message. Standard severities are exposed as constants (Silent, DebugLevel, InfoLevel, WarnLevel, ErrorLevel); custom severities can be constructed by calling MessageLevel(n) directly with any integer.
SciMLLogging.MessageLevel — Type
MessageLevelA concrete type representing a log message level, backed by an integer.
Higher integer values correspond to higher severity. The standard levels are available as constants: Silent, DebugLevel, InfoLevel, WarnLevel, ErrorLevel. Custom levels can be created with MessageLevel(n) for any integer n.
Each level apart from Silent corresponds to a Julia Logging LogLevel with an associated integer. See the Julia Logging documentation for more details.
Standard Message Levels
Silent Level
SciMLLogging.Silent — Constant
SilentLog level that produces no output.
The Silent level is special - it completely suppresses output for a message. As such, it does not have an associated LogLevel.
Debug Level
SciMLLogging.DebugLevel — Constant
DebugLevelDebug log level. Corresponds to Logging.Debug when using the Logging backend.
DebugLevel is for messages with a very low priority. By default, these messages are not logged at all, and the JULIA_DEBUG environment variable needs to be set. For details see the Julia Logging documentation.
Information Level
SciMLLogging.InfoLevel — Constant
InfoLevelInformational log level. Corresponds to Logging.Info when using the Logging backend.
Use InfoLevel for general status updates, progress information, and routine diagnostic messages that users might want to see during normal operation.
Warning Level
SciMLLogging.WarnLevel — Constant
WarnLevelWarning log level. Corresponds to Logging.Warn when using the Logging backend.
WarnLevel should be used for potentially problematic situations that don't prevent execution but may require user attention.
Error Level
SciMLLogging.ErrorLevel — Constant
ErrorLevelError log level. Corresponds to Logging.Error when using the Logging backend.
ErrorLevel is reserved for serious problems and failures that indicate something has gone wrong in the computation.
Custom Message Levels
For specialized use cases, you can construct a MessageLevel directly with any integer. This provides flexibility beyond the standard Info/Warn/Error hierarchy.
Usage Examples
using SciMLLogging
# Standard levels
debug_level = DebugLevel
info_level = InfoLevel
warn_level = WarnLevel
error_level = ErrorLevel
silent_level = Silent
# Custom levels for specialized needs
trace_level = MessageLevel(-500) # Low priority debugging
critical_level = MessageLevel(2000) # Higher than standard error levelLevel Hierarchy
The message levels have a natural hierarchy that affects logging behavior:
Silent: No output (always suppressed)DebugLevel: Lowest priority messageInfoLevel: Low priority for general informationWarnLevel: Medium priorityErrorLevel: Highest standard priorityMessageLevel(n): Priority determined by integer valuen
Higher priority messages are more likely to be displayed by logging systems, while lower priority messages may be filtered out depending on the logger configuration.