getStringMessageForLogger method
Formats the log message as a human-readable string for logging.
withCategory: If true, includes the category in the output.envActive: If true, includes the environment if it’s non-empty.withTimeLine: If true, includes the timeline identifier.
Returns: A formatted string suitable for display in a logger.
Implementation
String getStringMessageForLogger(
bool withCategory, bool envActive, bool withTimeLine) {
isDated = true;
return [
if (isDated) LogUtilities.getTimeStampedString(),
if (withTimeLine) '<$timeLine>',
if (level != LogLevel.none) '[${level.name.toUpperCase()}]',
if (envActive && environment.isNotEmpty) '$environment ##',
if (withCategory) '($category)',
'--> $message',
].join(' ');
}