Logger constructor

Logger({
  1. LogConfig? config,
})

Gets the singleton instance of the logger.

If config is provided, it will update the logger's configuration.

Implementation

factory Logger({LogConfig? config}) {
  _instance ??= Logger._internal(config ?? LogConfig.disabled());

  if (config != null && _instance != null) {
    _instance!.updateConfig(config);
  }

  return _instance!;
}