getStackTrace method

StackTrace? getStackTrace(
  1. _LogFactoryContent content
)

Returns the stack trace from the given content.

A base class for building structured logging mechanisms within Jet-based applications.

This class provides an in-memory logging facility with support for multiple LogLevels. Subclasses can extend this base to implement custom logging strategies (e.g., file, console, remote).

Each logger instance is tagged with a custom tag to allow filtering or identification in composite logs.

Usage

Extend this class to build a concrete logger:

class ConsoleLogger extends LoggerFactory {
  ConsoleLogger(String tag) : super(tag);

  void flush() {
    _logs.forEach((level, messages) {
      for (final message in messages) {
        print('[$tag][$level] $message');
      }
    });
  }
}

Then use:

final logger = ConsoleLogger("MyService");
logger.add(LogLevel.info, "Service started.");
logger.add(LogLevel.error, "Something went wrong.");
logger.flush();

Implementation

StackTrace? getStackTrace(_LogFactoryContent content) => content.stacktrace;