Module Message_templates_lwt.Lwt_console_sink

Lwt console sink for stdout/stderr output

Lwt console sink - async console output

type t = {
  1. output_template : string;
  2. use_colors : bool;
  3. stderr_threshold : Message_templates.Level.t;
}

Console sink type

val default_template : string

Default console output template

val format_timestamp : Ptime.t -> string

Format a timestamp for display

val level_color : Message_templates.Level.t -> string

Get color code for level

val reset_color : string

Reset color

val colorize : Message_templates.Level.t -> bool -> string -> string

Apply color to string if enabled

val format_output : t -> Message_templates.Log_event.t -> string

Simple template formatting

val emit : t -> Message_templates.Log_event.t -> unit Lwt.t

Emit a log event

val flush : 'a -> unit Lwt.t

Flush output

val close : 'a -> unit Lwt.t

Close the sink

val create : ?output_template:string -> ?colors:bool -> ?stderr_threshold:Message_templates.Level.t -> unit -> t

Create a new Lwt console sink