Add LogLevel config option
authorpacien <pacien.trangirard@pacien.net>
Tue, 15 Aug 2017 17:56:06 +0000 (19:56 +0200)
committerpacien <pacien.trangirard@pacien.net>
Tue, 15 Aug 2017 17:58:31 +0000 (19:58 +0200)
doc/tinc.conf.5.in
doc/tinc.texi
src/tincctl.c
src/tincd.c

index 8b67527a185aaa12baf19efcf1f6f52934391270..b4db2acb37673dcc020a8a8350dadeaa8196e86e 100644 (file)
@@ -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
index 6b02f10eb19f0b38310dde0aefce56af02c79eae..bf6d78b448867f40a94e88e0312273034e366b37 100644 (file)
@@ -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|switch|hub> (router)
 This option selects the way packets are routed to other daemons.
index e460784f94bb49d7565a89ac97ad006bd4953d49..0309cd4884ee3fc80ec93a993f552e536a2a9bbb 100644 (file)
@@ -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},
index 4da9bd54c4ce97a539558d466f9d1ecf5f420a7c..2ab9ba7a09160d8b14bbb0cad35ef5f66c897f24 100644 (file)
@@ -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!");