Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Shawn Webb
liblattutil
Commits
5cd833a8
Commit
5cd833a8
authored
Jul 15, 2021
by
Shawn Webb
Browse files
Documentation
Signed-off-by:
Shawn Webb
<
shawn.webb@hardenedbsd.org
>
parent
6d213cdf
Changes
2
Hide whitespace changes
Inline
Side-by-side
README.md
0 → 100644
View file @
5cd833a8
# liblattutil
*
License: 2-Clause BSD
*
Author: Shawn Webb
<shawn.webb@hardenedbsd.org>
This is a collection of code I've written over the years, rewritten to
be available as a C API. This project isn't fit for production use,
yet, and both the ABI and API may change arbitrarily.
## Logging
The logging API supports the following backends:
*
Dummy
*
Syslog
The dummy backend simply discards any messages passed to it. The
syslog backend sends messages to syslog, if the message meets or
exceeds the minimum verbosity configuration parameter. If
`-1`
is
passed as the verbosity level, a default minimum verbosity is set. The
current default is 1000.
Do not terminate the log message with a newline.
Sample syslog logging code:
```
#include <liblattutil.h>
lattutil_log_t *logp;
logp = lattutil_log_init("myApp", 5);
if (logp == NULL) {
Fatal();
}
/*
* if lattutil_log_syslog_init isn't called, the logger will use the
* dummy logger.
*/
lattutil_log_syslog_init(logp, LOG_PID, LOG_USER);
logp->ll_log_info(logp, 2, "This debugging message will get ignored"
" because 2 is less than 5");
logp->ll_log_info(logp, 5, "This will get logged");
lattutil_log_free(&logp);
```
include/liblattutil.h
View file @
5cd833a8
...
@@ -184,6 +184,13 @@ bool lattutil_log_ready(lattutil_log_t *);
...
@@ -184,6 +184,13 @@ bool lattutil_log_ready(lattutil_log_t *);
*/
*/
int
lattutil_log_verbosity
(
lattutil_log_t
*
);
int
lattutil_log_verbosity
(
lattutil_log_t
*
);
/**
* Set the minimum verbosity level
*
* @param Logging object
* @param Verbosity level
* @return The previous verbosity level
*/
int
lattutil_log_set_verbosity
(
lattutil_log_t
*
,
int
);
int
lattutil_log_set_verbosity
(
lattutil_log_t
*
,
int
);
#ifdef _lattutil_internal
#ifdef _lattutil_internal
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment