1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71
|
.TH "KDK_LOGGER_SETDIR" 3 "Fri Sep 22 2023" "My Project" \" -*- nroff -*-
.ad l
.nh
.SH NAME
kdk_logger_setdir \- 设置日志的存储目录
.SH SYNOPSIS
.br
.PP
\fC#include <libkylog\&.h>\fP
.br
.SS "Functions"
.SS "int int kdk_logger_setdir (const char * dpath)"
.PP
设置日志的存储目录,若不设置,非root程序会被记录在~/\&.log下,root程序会被记录在/var/log下
.PP
\fBParameters\fP
.RS 4
\fIdpath\fP
.RE
.PP
\fBReturns\fP
.RS 4
int
.RE
.PP
Link with \fI\-lkylog\fP.
.SH "Detailed Description"
.PP
接口的主要功能是设置日志的存储目录,若不设置,非root程序会被记录在~/.log下,root程序会被记录在/var/log下
.SH EXAMPLES
.EX
#include <libkylog.h>
#include <assert.h>
int main(int argc , char** argv)
{
assert(kdk_logger_init("/home/szm/szm_bak/kylinos-src/base/libkysdk-base/src/log/test/logtest.conf") == 0);
assert(kdk_logger_setdir("/tmp") == 0);
klog_calltrace();
klog_debug("Debug\n");
klog_info("Info\n");
klog_notice("Notice\n");
klog_warning("Warning\n");
klog_err("Error\n");
klog_crit("Crit\n");
klog_alert("Alert\n");
klog_emerg("Emerg\n");
return 0;
}
.SH "CONFORMING TO"
These functions are as per the withdrawn POSIX.1e draft specification.
The following functions are Linux extensions:
.BR kdk_logger_init (),
.BR kdk_logger_flush ()
and
.BR kdk_logger_set_autowrap ().
.SH "SEE ALSO"
.BR kdk_logger_init (3),
.BR kdk_logger_flush (3)
and
.BR kdk_logger_set_autowrap (3).
.SH "Author"
.PP
Generated automatically by Doxygen for libkylog.h from the source code\&.
|