Skip to main content

Overview

FastF1 uses Python’s built-in logging module to provide progress information, warnings, and error messages during data loading and processing. All parts of FastF1 generally log at the INFO level to give users feedback during long-running operations.

Quick Start

set_log_level()

Set the log level for all parts of FastF1. When setting the log level, only messages with this level or with a higher level will be shown. Parameters:
  • level (str | int): Either a log level from the logging module (e.g. logging.INFO) or the level as a string (e.g. 'WARNING')
Example:
Available Log Levels:
  • 'DEBUG' or logging.DEBUG - Detailed information for debugging
  • 'INFO' or logging.INFO - General progress information (default)
  • 'WARNING' or logging.WARNING - Warning messages
  • 'ERROR' or logging.ERROR - Error messages
  • 'CRITICAL' or logging.CRITICAL - Critical errors

LoggingManager

Interface for configuring logging in FastF1. All submodule loggers in FastF1 are child loggers of the base logger. This class acts as an interface to set the log level for FastF1 and get child loggers.

Attributes

debug

Flag for enabling debug mode. When set to True, this disables catch-all error handling for data loading methods, allowing exceptions to propagate fully. Setting debug mode:
When debug mode is enabled, FastF1 will raise all exceptions instead of handling them gracefully. This is useful for development but may cause data loading to fail completely on errors.

Methods

get_child()

Return a logger with the given name that is child of the base logger. Parameters:
  • name (str): Name of the child logger
Returns:
  • logging.Logger: Child logger instance

set_level()

Set the log level for FastF1. Parameters:
  • level (int): Log level, for example logging.INFO
It’s recommended to use the top-level fastf1.set_log_level() function instead of this method directly.

Utility Functions

get_logger()

Return a logger with the given name that is a child of FastF1’s base logger. This function is primarily used internally by FastF1 modules to get properly configured logger instances. Parameters:
  • name (str): Name for the logger (typically __name__ of the module)
Returns:
  • logging.Logger: Child logger instance
Example:

soft_exceptions()

Wrapper method for wrapping any function into catch-all error handling that can be disabled by setting LoggingManager.debug to True. This decorator is used internally by FastF1 to wrap data loading functions. With the default configuration, it catches all unhandled exceptions and logs them as warnings, allowing data loading to continue. When debug mode is enabled, exceptions are raised normally. Parameters:
  • descr_name (str): Descriptive name for the type of data that should have been loaded
  • msg (str): Short message shown as error message to users
  • logger (logging.Logger): Logger instance to use for logging errors
Returns:
  • Decorator function that can be applied to data loading functions
Example:
The soft_exceptions decorator will re-raise FastF1CriticalError exceptions even when debug mode is disabled, ensuring critical errors like rate limiting are always surfaced to the user.

Log Output Format

FastF1 uses a custom log format:
Example output:

Environment Variables

FASTF1_DEBUG

Set to '1' to enable debug mode.
When enabled:
  • A warning is issued: “Debug Mode enabled for Logger!”
  • Catch-all error handling is disabled
  • All exceptions are raised instead of being caught and logged

Common Use Cases

Reduce Logging Verbosity

If you find FastF1’s logging too verbose:

Debug Data Loading Issues

When troubleshooting data loading problems:

Integrate with Application Logging

To integrate FastF1 logging with your application’s logging: