API Reference

Types

SciMLLogging.MessageLevelType
MessageLevel

Abstract base type for all verbosity log levels in SciMLLogging.

Log levels determine the severity/importance of messages. Concrete subtypes include:

  • Silent: No output
  • InfoLevel: Informational messages
  • WarnLevel: Warning messages
  • ErrorLevel: Error messages
  • CustomLevel(n): Custom log level with integer value n
source
SciMLLogging.SilentType
Silent <: MessageLevel

Log level that produces no output. When a message category is set to Silent(), no messages will be emitted for that category.

source
SciMLLogging.InfoLevelType
InfoLevel <: MessageLevel

Informational log level. Messages at this level provide general information about the progress or state of the computation.

source
SciMLLogging.WarnLevelType
WarnLevel <: MessageLevel

Warning log level. Messages at this level indicate potential issues or situations that may require attention but don't prevent execution.

source
SciMLLogging.ErrorLevelType
ErrorLevel <: MessageLevel

Error log level. Messages at this level indicate serious problems or failures in the computation.

source
SciMLLogging.CustomLevelType
CustomLevel(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
source
SciMLLogging.VerbosityPresetType
VerbosityPreset

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 verbosity
  • All: Enable all message categories
  • Minimal: Only essential messages
  • Standard: Balanced verbosity for typical use
  • Detailed: Comprehensive verbosity for debugging
source
SciMLLogging.NoneType
None <: VerbosityPreset

Preset that disables all verbosity. When used, typically results in a verbosity specifier with T=false, providing zero runtime overhead.

source
SciMLLogging.AllType
All <: VerbosityPreset

Preset that enables maximum verbosity. All message categories are typically set to show informational messages or their appropriate levels.

source
SciMLLogging.MinimalType
Minimal <: VerbosityPreset

Preset that shows only essential messages. Typically includes only warnings, errors, and critical status information while suppressing routine progress and debugging messages.

source
SciMLLogging.StandardType
Standard <: VerbosityPreset

Preset that provides balanced verbosity suitable for typical usage. Shows important progress and status information without overwhelming the user with details.

source
SciMLLogging.DetailedType
Detailed <: 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.

source

Macros

SciMLLogging.@SciMLMessageMacro

A 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
source

Functions

SciMLLogging.verbosity_to_intFunction
    `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
source
SciMLLogging.verbosity_to_boolFunction
    `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.
source
SciMLLogging.SciMLLoggerFunction
SciMLLogger(; 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 REPL
  • warn_repl = true: Show warnings in REPL
  • error_repl = true: Show errors in REPL
  • info_file = nothing: File path for info messages
  • warn_file = nothing: File path for warnings
  • error_file = nothing: File path for errors
source
SciMLLogging.set_logging_backendFunction
set_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.

source

Index