Message_templates_lwtMessage Templates - Lwt Async Support
This package provides async logging support for the message-templates library using Lwt for non-blocking I/O operations.
Example usage:
open Message_templates
open Message_templates_lwt
let setup_logging () =
Configuration.create ()
|> Configuration.minimum_level Level.Information
|> Configuration.write_to_console ~colors:true ()
|> Configuration.write_to_file ~rolling:Daily "app.log"
|> Configuration.create_logger
;;
let main () =
let logger = setup_logging () in
let* () = Lwt_logger.information logger "Server starting" [] in
(* your async code here *)
Lwt.return ()
;;
let () = Lwt_main.run (main ())module Lwt_sink : sig ... endLwt sink interface and utilities
module Lwt_file_sink : sig ... endLwt file sink with rolling support
module Lwt_console_sink : sig ... endLwt console sink for stdout/stderr output
module Lwt_logger : sig ... endLwt logger implementation
module Configuration : sig ... endLwt configuration builder