debugLog function

void debugLog({
  1. Type? type,
  2. String tag = 'Debugger',
  3. String message = "No Message",
  4. LogColor color = LogColor.reset,
  5. LogColor tagColor = LogColor.reset,
  6. Object? error,
  7. StackTrace? stackTrace,
})

Logs a message with optional color, tag, and additional details.

  • type: The class or type generating the log (optional).
  • tag: A custom tag for the log (default is 'Debugger').
  • message: The log message (default is 'LOG').
  • color: The ANSI color for the log message (default is no color).
  • error: An optional error object to log.
  • stackTrace: An optional stack trace to log.

Implementation

void debugLog({
  Type? type,
  String tag = 'Debugger',
  String message = "No Message",
  LogColor color = LogColor.reset,
  LogColor tagColor = LogColor.reset,
  Object? error,
  StackTrace? stackTrace,
}) {
  String formattedMessage = '${color.code}$message${LogColor.reset.code}';
  String formattedName = '${tagColor.code}${type ?? tag}${LogColor.reset.code}';

  log(
    formattedMessage,
    name: formattedName,
    error: error,
    stackTrace: stackTrace,
  );
}