From 0014ca5c2e8bf93af99a3a1f619c81bbef39ca48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20O=2E=20Sel=C3=A5sdal?= Date: Fri, 25 Apr 2014 19:57:59 +0200 Subject: [PATCH] Move UC_LOG_DESTINATION enum to logging.c, it's not a public type --- include/ucore/logging.h | 16 +++------------- src/logging.c | 12 ++++++++++++ 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/include/ucore/logging.h b/include/ucore/logging.h index 0d7f72a..3c19f7d 100644 --- a/include/ucore/logging.h +++ b/include/ucore/logging.h @@ -83,18 +83,6 @@ enum UC_LOG_LEVEL { UC_LL_NONE = 9, }; -/** A destination for the logging messages*/ -enum UC_LOG_DESTINATION { - /** Logs using the unix syslog system */ - UC_LDEST_SYSLOG, - - /** Prints log messages to stderr. */ - UC_LDEST_STDERR, - - /** Prints log messages to a file */ - UC_LDEST_FILE, -}; - /** A module of a program, that will perform logging. * This is used group logging from parts of a larger program, * and allow the log message to identigy which module the @@ -149,11 +137,13 @@ enum UC_LOG_ROTATE_POLICY { struct UCLogRotateSettings { /** Policy */ enum UC_LOG_ROTATE_POLICY policy; + /** For UC_LOG_ROTATE_SIZE policy */ struct { /** Max size of an individual log file */ size_t max_size; - /** Max number of log files to keep. + /** Max number of extra log files to keep in addition + * to the current log file. * Is forced to be at least 1*/ unsigned int num_files; } size_settings; diff --git a/src/logging.c b/src/logging.c index 100f831..567696a 100644 --- a/src/logging.c +++ b/src/logging.c @@ -12,6 +12,18 @@ #include "ucore/logging.h" #include "ucore/utils.h" +/** A destination for the logging messages*/ +enum UC_LOG_DESTINATION { + /** Logs using the unix syslog system */ + UC_LDEST_SYSLOG, + + /** Prints log messages to stderr. */ + UC_LDEST_STDERR, + + /** Prints log messages to a file */ + UC_LDEST_FILE, +}; + /** Max suffixes we'll try to apply to a log file when rotating before * giving up */