Logger

object Logger
Companion:
class
class Object
trait Matchable
class Any
Logger.type

Type members

Classlikes

implicit class Ops[F[_]](logger: Logger[F]) extends LoggerOps[[F[_]] =>> Logger[F], F]

Value members

Concrete methods

def apply[F[_] : Monad](write: List[Event] => F[Unit])(implicit evidence$1: Monad[F], clock: Clock[F]): Logger[F]

Create a basic Logger that executes the given write function when an Event is received

Create a basic Logger that executes the given write function when an Event is received

This Logger performs no additional actions after evaluating the given timestamp, building the Event and forwarding it to the write function. It is therefore the callers responsibility to take care of asynchronicity and thread safety.

Use Logger.raw[F] to provide a custom timestamp that does not require an instance of Clock[F].

def batched[F[_] : Concurrent](timestamp: F[Long], logger: Logger[F], buffer: Int): Resource[F, Logger[F]]

Write all logs into a Queue and process them asynchronously as soon as at least buffer logs have accumulated

Write all logs into a Queue and process them asynchronously as soon as at least buffer logs have accumulated

The timestamp is used to set the Event time when it is added to the queue, the underlying Logger's timestamp is discarded.

def batched[F[_] : Concurrent](logger: Logger[F], buffer: Int)(implicit evidence$9: Concurrent[F], clock: Clock[F]): Resource[F, Logger[F]]

Write all logs into a Queue and process them asynchronously as soon as at least buffer logs have accumulated

Write all logs into a Queue and process them asynchronously as soon as at least buffer logs have accumulated

def broadcast[F[_] : Monad](loggers: List[Logger[F]])(implicit evidence$10: Monad[F], clock: Clock[F]): Logger[F]

Forward logs to all given loggers

Forward logs to all given loggers

def list[F[_] : Clock](target: Ref[F, List[Event]]): Logger[F]
def noTimestamp[F[_]](write: List[Event] => F[Unit])(implicit F: Applicative[F]): Logger[F]
def noop[F[_]](implicit F: Applicative[F]): Logger[F]

This Logger does nothing

This Logger does nothing

def output[F[_]](target: OutputStream, buffer: Int)(implicit F: Sync[F]): Resource[F, Logger[F]]
def queued[F[_] : Concurrent](timestamp: F[Long], logger: Logger[F]): Resource[F, Logger[F]]

Write all logs into a Queue and process them asynchronously

Write all logs into a Queue and process them asynchronously

The timestamp is used to set the Event time when it is added to the queue, the underlying Logger's timestamp is discarded.

def queued[F[_] : Concurrent](logger: Logger[F])(implicit evidence$7: Concurrent[F], clock: Clock[F]): Resource[F, Logger[F]]

Write all logs into a Queue and process them asynchronously

Write all logs into a Queue and process them asynchronously

def raw[F[_]](timestamp: F[Long], write: List[Event] => F[Unit])(implicit F: Monad[F]): Logger[F]

Create a basic Logger that executes the given write function when an Event is received

Create a basic Logger that executes the given write function when an Event is received

This Logger performs no additional actions after evaluating the given timestamp, building the Event and forwarding it to the write function. It is therefore the callers responsibility to take care of asynchronicity and thread safety.

Use Logger.apply[F] to get a timestamp that will automatically use the current time from Clock[F].

def stdOut[F[_] : Sync](buffer: Int): F[Logger[F]]
def stdOut[F[_] : Sync]: F[Logger[F]]
def unsafeOutput[F[_]](target: OutputStream, buffer: Int)(implicit F: Sync[F]): F[Logger[F]]

Implicits

Implicits

final implicit def Ops[F[_]](logger: Logger[F]): Ops[F]