summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/settings.h8
-rw-r--r--src/daemon/settings.c4
-rw-r--r--src/daemon/settings_private.h4
3 files changed, 12 insertions, 4 deletions
diff --git a/include/settings.h b/include/settings.h
index 72addd0..68360c0 100644
--- a/include/settings.h
+++ b/include/settings.h
@@ -22,6 +22,14 @@
#ifndef USURPATION_SETTINGS_H
#define USURPATION_SETTINGS_H
+enum verbosity {
+ SILENT = 0,
+ ERR = 1,
+ WARN,
+ DEBUG,
+ ALL
+};
+
void settings_init(void);
int setting_detach(void);
unsigned short int setting_port(void);
diff --git a/src/daemon/settings.c b/src/daemon/settings.c
index bac1c3b..4392300 100644
--- a/src/daemon/settings.c
+++ b/src/daemon/settings.c
@@ -30,7 +30,7 @@ void settings_init(void)
{
unset_flag(flag_daemonize);
settings.port = 6996;
- settings.verbosity = USURP_VERBOSITY;
+ settings.verboselevel = USURP_VERBOSITY;
}
int setting_detach(void)
@@ -40,7 +40,7 @@ int setting_detach(void)
int setting_verbose(void)
{
- return settings.verbosity;
+ return settings.verboselevel;
}
unsigned short int setting_port(void)
diff --git a/src/daemon/settings_private.h b/src/daemon/settings_private.h
index 7839cb9..ee49145 100644
--- a/src/daemon/settings_private.h
+++ b/src/daemon/settings_private.h
@@ -23,7 +23,7 @@
#define USURPATION_SETTINGS_PRIVATE_H
#ifndef USURP_VERBOSITY
- #define USURP_VERBOSITY 1
+ #define USURP_VERBOSITY ERR
#endif
static const unsigned int flag_daemonize = 1 << 0; /* 1st bit */
@@ -31,7 +31,7 @@ static const unsigned int flag_daemonize = 1 << 0; /* 1st bit */
static struct settings {
unsigned int flags;
unsigned short int port;
- int verbosity;
+ enum verbosity verboselevel;
} settings;
int test_flag(unsigned int flag);