2 * Copyright (c) 2019, Facebook, Inc.
5 * This source code is licensed under the MIT license found in the
6 * LICENSE file in the "hack" directory of this source tree.
10 (** enables logging to a file (in addition to stderr which is always enabled) *)
11 val set_log
: string -> unit
13 val set_id
: string -> unit
15 val get_id
: unit -> string option
17 val print_with_newline
:
18 ?exn
:Exception.t
-> ('a
, unit, string, unit) format4
-> 'a
20 val print_duration
: string -> float -> float
22 val exc
: ?prefix
:string -> stack
:string -> exn
-> unit
24 val exception_
: ?prefix
:string -> Exception.t
-> unit
36 val of_enum_string
: string -> t
option
38 val to_enum_string
: t
-> string
40 (** returns the min file log level *)
41 val min_level_file
: unit -> t
43 (** returns the min stderr log level *)
44 val min_level_stderr
: unit -> t
46 (** overwrites min level for both stderr and file (if enabled) *)
47 val set_min_level
: t
-> unit
49 (** overwrites min level for file (if enabled), but leaves stderr as is *)
50 val set_min_level_file
: t
-> unit
52 (** overwrites min level for stderr, but leaves file (if enabled) as is *)
53 val set_min_level_stderr
: t
-> unit
55 (** overwrites the set of categories that be checked for log level before
56 being output; when logs are logged with no category, then only the log
57 level is used to decide whether the log entry should be output;
58 if a category is specified when logging, then this list of categories
59 will be checked in addition to the log level *)
60 val set_categories
: string list
-> unit
62 (** returns true if t passes either stderr or file min level (regardless whether file is enabled) *)
63 val passes_min_level
: t
-> bool
65 (** logs the message and how long the presumed operation took, assuming that
66 the float argument is the start time and that the end time is now *)
67 val log_duration
: t
-> ?category
:string -> string -> float -> float
73 ('a
, unit, string, string, string, unit) format6
->
76 val log_lazy
: ?lvl
:Level.t
-> ?category
:string -> string lazy_t
-> unit
78 val log_duration
: ?lvl
:Level.t
-> ?category
:string -> string -> float -> float
83 ('a
, unit, string, string, string, unit) format6
->
89 ('a
, unit, string, string, string, unit) format6
->
95 ('a
, unit, string, string, string, unit) format6
->
101 ('a
, unit, string, string, string, unit) format6
->
107 ('a
, unit, string, string, string, unit) format6
->