comparison man/libirccd-log.3 @ 1013:efeb73a9918b

man: add C API for what is mostly stabilized
author David Demelier <markand@malikania.fr>
date Wed, 17 Feb 2021 18:16:19 +0100
parents
children e76044862cce
comparison
equal deleted inserted replaced
1012:027ef1952696 1013:efeb73a9918b
1 .\"
2 .\" Copyright (c) 2013-2021 David Demelier <markand@malikania.fr>
3 .\"
4 .\" Permission to use, copy, modify, and/or distribute this software for any
5 .\" purpose with or without fee is hereby granted, provided that the above
6 .\" copyright notice and this permission notice appear in all copies.
7 .\"
8 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 .\"
16 .Dd @IRCCD_MAN_DATE@
17 .Dt LIBIRCCD-LOG 3
18 .Os
19 .\" NAME
20 .Sh NAME
21 .Nm libirccd-log
22 .Nd loggers
23 .\" SYNOPSIS
24 .Sh SYNOPSIS
25 .In irccd/log.h
26 .Ft void
27 .Fn irc_log_to_syslog "void"
28 .Ft void
29 .Fn irc_log_to_console "void"
30 .Ft void
31 .Fn irc_log_to_file "const char *path"
32 .Ft void
33 .Fn irc_log_to_null "void"
34 .Ft void
35 .Fn irc_log_set_verbose "int verbose"
36 .Ft void
37 .Fn irc_log_info "const char *fmt, ..."
38 .Ft void
39 .Fn irc_log_warn "const char *fmt, ..."
40 .Ft void
41 .Fn irc_log_debug "const char *fmt, ..."
42 .Ft void
43 .Fn irc_log_finish "void"
44 .\" DESCRIPTION
45 .Sh DESCRIPTION
46 This header provides functions to log messages into the configured
47 .Xr irccd 1
48 loggers.
49 .Pp
50 Messages should always be prefixed by its component. For example, server
51 messages start with
52 .Dq server <id>:
53 and plugins
54 .Dq plugin <id>: .
55 .Pp
56 The
57 .Fn irc_log_to_syslog ,
58 .Fn irc_log_to_console
59 and
60 .Fn irc_log_to_null
61 set the logger to the
62 .Xr syslog 3
63 mechanism, standard output/error and completely quiet respectively. The
64 .Fn irc_log_to_file
65 uses the file specified by
66 .Pa path
67 to log everything. All those functions will close the current adapter before
68 changing it.
69 .Pp
70 The
71 .Fn irc_log_set_verbose
72 change the verbosity to on if
73 .Fa verbose
74 is greater than 0 (which is the default).
75 .Pp
76 The
77 .Fn irc_log_info
78 uses the
79 .Xr printf 3
80 like format to log information messages. Thoses messages are ignored if the
81 verbosity is null.
82 .Pp
83 The
84 .Fn irc_log_warn
85 function logs a warning message, it is always written even if verbosity is null.
86 .Pp
87 The
88 .Fn irc_log_debug
89 only write messages if the daemon was built in
90 .Dq debug
91 mode, it also ignores the verbosity level.
92 .Pp
93 The
94 .Fn irc_log_finish
95 function closes the current adapter. It is usually not required from the user
96 itself.
97 .\" SEE ALSO
98 .Sh SEE ALSO
99 .Xr libirccd 3