aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2011-02-18 20:37:04 +0100
committerHarald Welte <laforge@gnumonks.org>2011-02-18 20:37:04 +0100
commit2822296ddb22389c5b4e9b8fb6ef7c906ff99314 (patch)
tree5a05ad56e7ac5730bb98d12eef4aa527e4c7d0d9 /include
parent46cfd77f7521ad53934e1e42057723b4cd52d241 (diff)
LOGGING: configure logging from the vty
We can now configure logging to (multiple) files, stderr and syslog from the vty command line in a persistent way (config file)
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/vty/command.h1
-rw-r--r--include/osmocore/logging.h13
-rw-r--r--include/osmocore/utils.h3
3 files changed, 17 insertions, 0 deletions
diff --git a/include/osmocom/vty/command.h b/include/osmocom/vty/command.h
index 69e9e772..caf04142 100644
--- a/include/osmocom/vty/command.h
+++ b/include/osmocom/vty/command.h
@@ -70,6 +70,7 @@ enum node_type {
CONFIG_NODE, /* Config node. Default mode of config file. */
SERVICE_NODE, /* Service node. */
DEBUG_NODE, /* Debug node. */
+ CFG_LOG_NODE, /* Configure the logging */
VTY_NODE, /* Vty node. */
diff --git a/include/osmocore/logging.h b/include/osmocore/logging.h
index d4d632d8..a2c63e9a 100644
--- a/include/osmocore/logging.h
+++ b/include/osmocore/logging.h
@@ -69,6 +69,13 @@ struct log_info {
unsigned int num_cat;
};
+enum log_target_type {
+ LOG_TGT_TYPE_VTY,
+ LOG_TGT_TYPE_SYSLOG,
+ LOG_TGT_TYPE_FILE,
+ LOG_TGT_TYPE_STDERR,
+};
+
struct log_target {
struct llist_head entry;
@@ -80,6 +87,8 @@ struct log_target {
int use_color:1;
int print_timestamp:1;
+ enum log_target_type type;
+
union {
struct {
FILE *out;
@@ -88,6 +97,7 @@ struct log_target {
struct {
int priority;
+ int facility;
} tgt_syslog;
struct {
@@ -138,4 +148,7 @@ void log_del_target(struct log_target *target);
const char *log_vty_category_string(struct log_info *info);
const char *log_vty_level_string(struct log_info *info);
+struct log_target *log_target_find(int type, const char *fname);
+extern struct llist_head osmo_log_target_list;
+
#endif /* _OSMOCORE_LOGGING_H */
diff --git a/include/osmocore/utils.h b/include/osmocore/utils.h
index 6fe1b388..0cdf03b8 100644
--- a/include/osmocore/utils.h
+++ b/include/osmocore/utils.h
@@ -24,4 +24,7 @@ char *ubit_dump(const uint8_t *bits, unsigned int len);
#define static_assert(exp, name) typedef int dummy##name [(exp) ? 1 : -1];
+void osmo_str2lower(char *out, const char *in);
+void osmo_str2upper(char *out, const char *in);
+
#endif