API Reference
Types
SciMLLogging.AbstractVerbositySpecifier
— TypeAbstractVerbositySpecifier{T} Base for types which specify which log messages are emitted at what level.
SciMLLogging.MessageLevel
— TypeMessageLevel
Abstract base type for all verbosity log levels in SciMLLogging.
Log levels determine the severity/importance of messages. Concrete subtypes include:
Silent
: No outputInfoLevel
: Informational messagesWarnLevel
: Warning messagesErrorLevel
: Error messagesCustomLevel(n)
: Custom log level with integer valuen
SciMLLogging.Silent
— TypeSilent <: MessageLevel
Log level that produces no output. When a message category is set to Silent()
, no messages will be emitted for that category.
SciMLLogging.InfoLevel
— TypeInfoLevel <: MessageLevel
Informational log level. Messages at this level provide general information about the progress or state of the computation.
SciMLLogging.WarnLevel
— TypeWarnLevel <: MessageLevel
Warning log level. Messages at this level indicate potential issues or situations that may require attention but don't prevent execution.
SciMLLogging.ErrorLevel
— TypeErrorLevel <: MessageLevel
Error log level. Messages at this level indicate serious problems or failures in the computation.
SciMLLogging.CustomLevel
— TypeCustomLevel(n::Int) <: MessageLevel
Custom log level with integer value n
. This allows creating custom severity levels beyond the standard Info/Warn/Error hierarchy.
Higher integer values typically indicate higher priority/severity.
Example
debug_level = CustomLevel(-1000) # Very low priority debug messages
critical_level = CustomLevel(1000) # Very high priority critical messages
SciMLLogging.VerbosityPreset
— TypeVerbosityPreset
Abstract base type for predefined verbosity configurations.
Presets provide convenient ways for users to configure verbosity without needing to specify individual message categories. Concrete subtypes include:
None
: Disable all verbosityAll
: Enable all message categoriesMinimal
: Only essential messagesStandard
: Balanced verbosity for typical useDetailed
: Comprehensive verbosity for debugging
SciMLLogging.None
— TypeNone <: VerbosityPreset
Preset that disables all verbosity. When used, typically results in a verbosity specifier with T=false
, providing zero runtime overhead.
SciMLLogging.All
— TypeAll <: VerbosityPreset
Preset that enables maximum verbosity. All message categories are typically set to show informational messages or their appropriate levels.
SciMLLogging.Minimal
— TypeMinimal <: VerbosityPreset
Preset that shows only essential messages. Typically includes only warnings, errors, and critical status information while suppressing routine progress and debugging messages.
SciMLLogging.Standard
— TypeStandard <: VerbosityPreset
Preset that provides balanced verbosity suitable for typical usage. Shows important progress and status information without overwhelming the user with details.
SciMLLogging.Detailed
— TypeDetailed <: VerbosityPreset
Preset that provides comprehensive verbosity for debugging and detailed analysis. Shows most or all available message categories to help with troubleshooting and understanding program behavior.
Macros
SciMLLogging.@SciMLMessage
— MacroA macro that emits a log message based on the log level specified in the option
of the AbstractVerbositySpecifier
supplied.
f_or_message
may be a message String, or a 0-argument function that returns a String.
Usage
To emit a simple string, @SciMLMessage("message", verbosity, :option)
will emit a log message with the LogLevel specified in verbosity
for the given option
.
@SciMLMessage
can also be used to emit a log message coming from the evaluation of a 0-argument function. This function is resolved in the environment of the macro call. Therefore it can use variables from the surrounding environment. This may be useful if the log message writer wishes to carry out some calculations using existing variables and use them in the log message.
# String message
@SciMLMessage("Hello", verbose, :test1)
# Function for lazy evaluation
x = 10
y = 20
@SciMLMessage(verbosity, :option) do
z = x + y
"Sum: $z"
end
Functions
SciMLLogging.verbosity_to_int
— Function `verbosity_to_int(verb::MessageLevel)`
Takes a `MessageLevel` and gives a corresponding integer value.
Verbosity settings that use integers or enums that hold integers are relatively common.
This provides an interface so that these packages can be used with SciMLVerbosity. Each of the basic verbosity levels
are mapped to an integer.
- Silent() => 0
- InfoLevel() => 1
- WarnLevel() => 2
- ErrorLevel() => 3
- CustomLevel(i) => i
SciMLLogging.verbosity_to_bool
— Function `verbosity_to_bool(verb::MessageLevel)`
Takes a `MessageLevel` and gives a corresponding boolean value.
Verbosity settings that use booleans are relatively common.
This provides an interface so that these packages can be used with SciMLVerbosity.
If the verbosity is `Silent`, then `false` is returned. Otherwise, `true` is returned.
SciMLLogging.SciMLLogger
— FunctionSciMLLogger(; kwargs...)
Create a logger that routes messages to REPL and/or files based on log level.
Keyword Arguments
info_repl = true
: Show info messages in REPLwarn_repl = true
: Show warnings in REPLerror_repl = true
: Show errors in REPLinfo_file = nothing
: File path for info messageswarn_file = nothing
: File path for warningserror_file = nothing
: File path for errors
SciMLLogging.set_logging_backend
— Functionset_logging_backend(backend::String)
Set the logging backend preference. Valid options are:
- "logging": Use Julia's standard Logging system (default)
- "core": Use Core.println for simple output
Note: You must restart Julia for this preference change to take effect.
SciMLLogging.get_logging_backend
— Functionget_logging_backend() -> String
Get the current logging backend preference.
Index
SciMLLogging.AbstractVerbositySpecifier
SciMLLogging.All
SciMLLogging.CustomLevel
SciMLLogging.Detailed
SciMLLogging.ErrorLevel
SciMLLogging.InfoLevel
SciMLLogging.MessageLevel
SciMLLogging.Minimal
SciMLLogging.None
SciMLLogging.Silent
SciMLLogging.Standard
SciMLLogging.VerbosityPreset
SciMLLogging.WarnLevel
SciMLLogging.SciMLLogger
SciMLLogging.get_logging_backend
SciMLLogging.set_logging_backend
SciMLLogging.verbosity_to_bool
SciMLLogging.verbosity_to_int
SciMLLogging.@SciMLMessage