From 7c223917cb3d478fc3f5b23ee5602925f083e4d4 Mon Sep 17 00:00:00 2001 From: pacien Date: Tue, 15 Aug 2017 19:56:06 +0200 Subject: [PATCH] Add LogLevel config option --- doc/tinc.conf.5.in | 2 ++ doc/tinc.texi | 5 +++++ src/tincctl.c | 1 + src/tincd.c | 3 +++ 4 files changed, 11 insertions(+) diff --git a/doc/tinc.conf.5.in b/doc/tinc.conf.5.in index 8b67527a..b4db2acb 100644 --- a/doc/tinc.conf.5.in +++ b/doc/tinc.conf.5.in @@ -369,6 +369,8 @@ and they only ConnectTo a third node outside the NAT, which normally would prevent the peers from learning each other's LAN address. .Pp Currently, local discovery is implemented by sending some packets to the local address of the node during UDP discovery. This will not work with old nodes that don't transmit their local address. +.It Va LogLevel Li = level Pq 0 +This option controls the verbosity of the logging. The higher the debug level, the more messages it will log. .It Va MACExpire Li = Ar seconds Pq 600 This option controls the amount of time MAC addresses are kept before they are removed. This only has effect when diff --git a/doc/tinc.texi b/doc/tinc.texi index 6b02f10e..bf6d78b4 100644 --- a/doc/tinc.texi +++ b/doc/tinc.texi @@ -1092,6 +1092,11 @@ which normally would prevent the peers from learning each other's LAN address. Currently, local discovery is implemented by sending some packets to the local address of the node during UDP discovery. This will not work with old nodes that don't transmit their local address. +@cindex LogLevel +@item LogLevel = <@var{level}> (0) +This option controls the verbosity of the logging. +See @ref{Debug levels}. + @cindex Mode @item Mode = (router) This option selects the way packets are routed to other daemons. diff --git a/src/tincctl.c b/src/tincctl.c index e460784f..0309cd48 100644 --- a/src/tincctl.c +++ b/src/tincctl.c @@ -1494,6 +1494,7 @@ const var_t variables[] = { {"KeyExpire", VAR_SERVER}, {"ListenAddress", VAR_SERVER | VAR_MULTIPLE}, {"LocalDiscovery", VAR_SERVER}, + {"LogLevel", VAR_SERVER}, {"MACExpire", VAR_SERVER}, {"MaxConnectionBurst", VAR_SERVER}, {"MaxOutputBufferSize", VAR_SERVER}, diff --git a/src/tincd.c b/src/tincd.c index 4da9bd54..2ab9ba7a 100644 --- a/src/tincd.c +++ b/src/tincd.c @@ -400,6 +400,9 @@ int main(int argc, char **argv) { if(!read_server_config()) return 1; + if(!debug_level) + get_config_int(lookup_config(config_tree, "LogLevel"), &debug_level); + #ifdef HAVE_LZO if(lzo_init() != LZO_E_OK) { logger(DEBUG_ALWAYS, LOG_ERR, "Error initializing LZO compressor!"); -- 2.20.1