LoggerSyntax

class LoggerSyntax[F[_]](logger: Logger[F])
class Object
trait Matchable
class Any

Value members

Concrete methods

def contramap(f: LoggerMessage => LoggerMessage)(clock: Clock[F], F: Monad[F]): Logger[F]

Modify logger message before it's written to the logger

Modify logger message before it's written to the logger

def filter(f: LoggerMessage => Boolean)(clock: Clock[F], F: Monad[F]): Logger[F]

Filter messages given the predicate. Falsified cases are dropped from the logging

Filter messages given the predicate. Falsified cases are dropped from the logging

def withAsync(timeWindow: FiniteDuration, maxBufferSize: Option[Int])(F: Async[F]): Resource[F, Logger[F]]

Create async logger that buffers the messages up to the limit (if any) and flushes it down the chain each timeWindow

Create async logger that buffers the messages up to the limit (if any) and flushes it down the chain each timeWindow

Value Params
maxBufferSize

max logs buffer size

timeWindow

pause between async buffer flushing

Returns

Logger suspended in Resource. Once this Resource started, internal flush loop is initialized. Once resource is released, flushing is also stopped.

def withAsyncUnsafe(timeWindow: FiniteDuration, maxBufferSize: Option[Int])(F: Async[F], dispatcher: Dispatcher[F]): Logger[F]

Create and unsafely run async logger that buffers the messages up to the limit (if any) and flushes it down the chain each timeWindow

Create and unsafely run async logger that buffers the messages up to the limit (if any) and flushes it down the chain each timeWindow

Value Params
maxBufferSize

max logs buffer size

timeWindow

pause between async buffer flushing

def withConstContext(ctx: Map[String, String])(clock: Clock[F], monad: Monad[F]): Logger[F]

Create logger that adds constant context to each log record

Create logger that adds constant context to each log record

Value Params
ctx

constant context

def withContext(clock: Clock[F], monad: Monad[F], withContext: WithContext[F]): Logger[F]

Create contextual logger that is capable of picking up context from inside of F[_]. See ContextualLogger for more info

Create contextual logger that is capable of picking up context from inside of F[_]. See ContextualLogger for more info

def withSecretContext(key: String, keys: String*)(clock: Clock[F], monad: Monad[F]): Logger[F]

Create logger that hashes context value given that context key matches one of the arguments

Create logger that hashes context value given that context key matches one of the arguments