loadContext static method

LogError loadContext(
  1. String path, {
  2. Map<String, dynamic Function(LogMessage message)>? processMap,
})

Loads a YAML file to initialize the different loggers.

This function reads the file specified by path and uses its content to configure the internal loggers. The YAML file should define log categories and their associated outputs (e.g., console, files).

  • path: The path to the YAML configuration file.

Returns: A LogError indicating the result of the operation.

Implementation

static LogError loadContext(String path,
    {Map<String, Function(LogMessage message)>? processMap}) {
  return isCriticalMode
      ? LogError(-5, message: 'is in critical mode')
      : loggerManager.loadContext(path, processMap: processMap);
}