LogModule

PackageAxial.PlatformService
Helpers for the logging service.

Summary

NameSignatureSynopsis
serviceLog.service Reads the service from the environment.
logLog.log level messageWrites a log message at the requested level through an explicit logging service.
traceLog.trace messageWrites a trace log message through an explicit logging service.
debugLog.debug messageWrites a debug log message through an explicit logging service.
infoLog.info messageWrites an informational log message through an explicit logging service.
warningLog.warning messageWrites a warning log message through an explicit logging service.
errorLog.error messageWrites an error log message through an explicit logging service.
criticalLog.critical messageWrites a critical log message through an explicit logging service.
logExceptionLog.logException level error messageWrites a log message carrying an exception through an explicit logging service.
errorExnLog.errorExn error messageWrites an error log message carrying an exception through an explicit logging service.
criticalExnLog.criticalExn error messageWrites a critical log message carrying an exception through an explicit logging service.
liveLog.live Creates a no-op logger for tests and local service bundles.
fromSinkLog.fromSink sinkCreates a logger from a synchronous sink function.
layerLog.layer Builds the live logger as a layer.

service

Log.service
Member
Reads the service from the environment.

Returns

Flow<'env, 'error, ILog>

log

Log.log level message
Member
Writes a log message at the requested level through an explicit logging service.

Parameters

NameTypeDescription
levelLogLevel
messagestring

Returns

Flow<'env, 'error, unit>

trace

Log.trace message
Member
Writes a trace log message through an explicit logging service.

Parameters

NameTypeDescription
messagestring

Returns

Flow<'env, 'error, unit>

debug

Log.debug message
Member
Writes a debug log message through an explicit logging service.

Parameters

NameTypeDescription
messagestring

Returns

Flow<'env, 'error, unit>

info

Log.info message
Member
Writes an informational log message through an explicit logging service.

Parameters

NameTypeDescription
messagestring

Returns

Flow<'env, 'error, unit>

warning

Log.warning message
Member
Writes a warning log message through an explicit logging service.

Parameters

NameTypeDescription
messagestring

Returns

Flow<'env, 'error, unit>

error

Log.error message
Member
Writes an error log message through an explicit logging service.

Parameters

NameTypeDescription
messagestring

Returns

Flow<'env, 'error, unit>

critical

Log.critical message
Member
Writes a critical log message through an explicit logging service.

Parameters

NameTypeDescription
messagestring

Returns

Flow<'env, 'error, unit>

logException

Log.logException level error message
Member
Writes a log message carrying an exception through an explicit logging service.

Parameters

NameTypeDescription
levelLogLevel
errorexn
messagestring

Returns

Flow<'env, 'error, unit>

errorExn

Log.errorExn error message
Member
Writes an error log message carrying an exception through an explicit logging service.

Parameters

NameTypeDescription
errorexn
messagestring

Returns

Flow<'env, 'error, unit>

criticalExn

Log.criticalExn error message
Member
Writes a critical log message carrying an exception through an explicit logging service.

Parameters

NameTypeDescription
errorexn
messagestring

Returns

Flow<'env, 'error, unit>

live

Log.live
Member
Creates a no-op logger for tests and local service bundles.

Returns

ILog

fromSink

Log.fromSink sink
Member
Creates a logger from a synchronous sink function. Exceptions are appended to the message text.

Parameters

NameTypeDescription
sinkLogLevel -> string -> unit

Returns

ILog

layer

Log.layer
Member
Builds the live logger as a layer.

Returns

Layer<unit, Never, ILog>