TLogger constructor

TLogger(
  1. String label, {
  2. LogLevel level = LogLevel.debug,
  3. bool isEnabled = true,
  4. String labelColor = "\x1B[35m",
  5. String labelTimeColor = "\x1B[34m",
  6. dynamic outputFunction(
    1. String
    )?,
})

Constructor for TLogger.

label - Identifier for the log source. level - Minimum level of logs to output. isEnabled - Flag to enable or disable logging. labelColor - Color code for the label. labelTimeColor - Color code for the timestamp. outputFunction - Custom function for outputting logs.

Implementation

TLogger(
  this.label, {
  this.level = LogLevel.debug,
  this.isEnabled = true,
  String labelColor = "\x1B[35m", // Magenta
  String labelTimeColor = "\x1B[34m", // Blue
  Function(String)? outputFunction,
})  : _labelColorCode = labelColor,
      _labelTimeColorCode = labelTimeColor {
  _outputFunction = outputFunction ?? developer.log;
}