KDK_LOGGER_SETDIR(3)

NAME
kdk_logger_setdir - 设置日志的存储目录

SYNOPSIS

#include <libkylog.h>

  Functions

  int int kdk_logger_setdir (const char * dpath)

设置日志的存储目录，若不设置，非root程序会被记录在~/.log下，root程序会被记录在/var/log下

Parameters
    dpath

Returns
    int

Link with -lkylog.

Detailed Description

接口的主要功能是设置日志的存储目录，若不设置，非root程序会被记录在~/.log下，root程序会被记录在/var/log下

EXAMPLES
    #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);
    	klog_info("Info);
    	klog_notice("Notice);
    	klog_warning("Warning);
    	klog_err("Error);
    	klog_crit("Crit);
    	klog_alert("Alert);
    	klog_emerg("Emerg);
    	return 0;
    }

CONFORMING TO
These functions are as per the withdrawn POSIX.1e draft specification. The following functions are Linux extensions: kdk_logger_init(), kdk_logger_flush() and kdk_logger_set_autowrap().

SEE ALSO
kdk_logger_init(3), kdk_logger_flush(3) and kdk_logger_set_autowrap(3).

Author

Generated automatically by Doxygen for libkylog.h from the source code.