log<R, E> static method
Log a message using the Logger service. It uses the loggerLayer to access the Logger.
Implementation
static ZIO<R, E, Unit> log<R, E>(
LogLevel level,
Object? message, {
Map<String, dynamic>? annotations,
}) =>
ZIO.from((ctx) => ctx
.accessLayer<E, Logger>(loggerLayer)
.flatMap(
(log) => log.log(
level,
DateTime.now(),
message.toString(),
annotations: ctx
.unsafeGetAnnotations(loggerAnnotationsSymbol)
.addMap(annotations ?? {}),
),
)
.unsafeRun(ctx));