Logging

Symbolica documentation for getting started, symbolic expressions, numerical evaluation, pattern matching, and APIs in Python and Rust.

Symbolica uses logging with tracing in Rust instead of writing information directly to the screen. This can help if the output of Symbolica is not read by a human as the program runs, or if the logs should be parsed/analyzed for later use.

To override the default logger, perform the following operations:

Use the logging module:

from symbolica import *
import logging

use_custom_logging() # log using the logging module

FORMAT = '%(levelname)s %(name)s %(asctime)-15s %(filename)s:%(lineno)d %(message)s'
logging.basicConfig(format=FORMAT)
logging.getLogger('symbolica').setLevel(logging.INFO)
fn main() {
    symbolica::GLOBAL_SETTINGS
        .initialize_tracing
        .store(false, std::sync::atomic::Ordering::Relaxed);

    // now install your own tracing_subscriber
}