Logger

io.taig.flog.Logger
See theLogger companion class
object Logger

Attributes

Companion
class
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Logger.type

Members list

Type members

Classlikes

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

Attributes

Supertypes
class LoggerOps[[F[_]] =>> Logger[F], F]
class Object
trait Matchable
class Any

Value members

Concrete methods

def apply[F[_]](write: (List[Event]) => F[Unit])(using 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].

Attributes

def batched[F[_]](timestamp: F[Long], logger: Logger[F], buffer: Int)(using evidence$1: Concurrent[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

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

Attributes

def batched[F[_]](logger: Logger[F], buffer: Int)(using evidence$1: 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

Attributes

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

Forward logs to all given loggers

Forward logs to all given loggers

Attributes

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

This Logger does nothing

This Logger does nothing

Attributes

def output[F[_]](target: OutputStream, buffer: Int)(using F: Sync[F]): Resource[F, Logger[F]]
def queued[F[_]](timestamp: F[Long], logger: Logger[F])(using evidence$1: Concurrent[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.

Attributes

def queued[F[_]](logger: Logger[F])(using evidence$1: 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

Attributes

def raw[F[_]](timestamp: F[Long], write: (List[Event]) => F[Unit])(using 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].

Attributes

def stdOut[F[_]](buffer: Int)(using evidence$1: Sync[F]): F[Logger[F]]
def stdOut[F[_]](using evidence$1: Sync[F]): F[Logger[F]]
def unsafeOutput[F[_]](target: OutputStream, buffer: Int)(using F: Sync[F]): F[Logger[F]]

Implicits

Implicits

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