getLog static method

Log getLog(
  1. Type type, {
  2. bool canPublish = true,
})

Returns a new Log instance for the given type.

A convenient logging utility built on top of LogFactory.

The Log class provides a simplified and readable interface for logging messages at various log levels such as info, warning, error, debug, fatal, and trace. It is typically used throughout the JetLeaf framework to emit consistent and structured log output.

Example:

final log = Log('MyComponent');

log.info('Application started.');
log.error('Something went wrong.', error: exception, stacktrace: stack);
log.debug('Debugging some internal state...');

The tag passed to the constructor is used to identify the origin of log messages, such as a class or module name.

This class is final, so it cannot be extended.

Implementation

static Log getLog(Type type, {bool canPublish = true}) => Log(type.toString(), canPublish: canPublish);