Module Ocsigen_messages

module Ocsigen_messages : sig..end

Writing messages in the logs


val accesslog : string -> unit

Write a message in access.log

val errlog : ?section:Lwt_log.section -> string -> unit

Write a message in errors.log

val warning : ?section:Lwt_log.section -> string -> unit

Write a message in warnings.log

val debug : (unit -> string) -> unit

Write a message only in debugging mode (-V option) - Non cooperative

val debug2 : string -> unit

Write a message only in debugging mode (-V option) - Non cooperative

val debug_noel : (unit -> string) -> unit

Same as debug without new line at the end - Non cooperative

val debug_noel2 : string -> unit

Same as debug without new line at the end - Non cooperative

val console : (unit -> string) -> unit

Write a message in the console (if not called in silent mode)

val console2 : string -> unit

Write a message in the console (if not called in silent mode)

val unexpected_exception : exn -> string -> unit

Use that function for all impossible cases in exception handlers (try ... with ... | e -> unexpected_exception ... or Lwt.catch ...). A message will be written in warnings.log. Put something in the string to help locating the problem (usually the name of the function where is has been called).

val error_log_path : unit -> string

Path to the error log file

val register_section : Lwt_log.section -> unit

Register sections (so as to be able to dynamically change their level) Level change is obtain by piping `logs: <section_name> <level_name>` to the Ocsigen command-pipe. Parameter <section_name> must be the name of a registered section (or else nothing happens), and <level_name> must be one of `Debug`, `Info`, `Notice`, `Warning`, `Error`, `Fatal` (or else the default level is restored)