]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
rec: allow loglevel to be set to levels < 3 13277/head
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 19 Sep 2023 07:47:31 +0000 (09:47 +0200)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Tue, 19 Sep 2023 07:48:18 +0000 (09:48 +0200)
Fixes #13264

Also document what happens if quiet is set.

pdns/recursordist/docs/settings.rst
pdns/recursordist/docs/yamlsettings.rst
pdns/recursordist/rec-main.cc
pdns/recursordist/settings/table.py

index 23682e1a01f82b18807d34078ddec68c200b8ae1..ac2dbea96319a559381fd5919b32054110c4a4bb 100644 (file)
@@ -1229,6 +1229,9 @@ This feature is intended to facilitate ip-failover setups, but it may also mask
 
 ``loglevel``
 ~~~~~~~~~~~~
+.. versionchanged:: 5.0.0
+
+  Previous version would not allow setting a level below ``3 (error)``.
 
 -  Integer
 -  Default: 6
@@ -1236,9 +1239,10 @@ This feature is intended to facilitate ip-failover setups, but it may also mask
 - YAML setting: :ref:`setting-yaml-logging.loglevel`
 
 Amount of logging. The higher the number, the more lines logged.
-Corresponds to 'syslog' level values (e.g. 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notice, 6 = info, 7 = debug).
+Corresponds to ``syslog`` level values (e.g. 0 = ``emergency``, 1 = ``alert``, 2 = ``critical``, 3 = ``error``, 4 = ``warning``, 5 = ``notice``, 6 = ``info``, 7 = ``debug``).
 Each level includes itself plus the lower levels before it.
 Not recommended to set this below 3.
+If :ref:`setting-quiet` is ``no/false``, :ref:`setting-loglevel` will be minimally set to ``6 (info)``.
 
 .. _setting-log-common-errors:
 
index ccaa639cc3dc7e298eff5f5e90073510e4e711f2..9d82b106c2d08bb1fbf159ff551b5ae0a0f3f612 100644 (file)
@@ -1065,6 +1065,9 @@ Do not pass names like 'local0'!
 
 ``logging.loglevel``
 ^^^^^^^^^^^^^^^^^^^^
+.. versionchanged:: 5.0.0
+
+  Previous version would not allow setting a level below ``3 (error)``.
 
 -  Integer
 -  Default: ``6``
@@ -1072,9 +1075,10 @@ Do not pass names like 'local0'!
 - Old style setting: :ref:`setting-loglevel`
 
 Amount of logging. The higher the number, the more lines logged.
-Corresponds to 'syslog' level values (e.g. 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notice, 6 = info, 7 = debug).
+Corresponds to ``syslog`` level values (e.g. 0 = ``emergency``, 1 = ``alert``, 2 = ``critical``, 3 = ``error``, 4 = ``warning``, 5 = ``notice``, 6 = ``info``, 7 = ``debug``).
 Each level includes itself plus the lower levels before it.
 Not recommended to set this below 3.
+If :ref:`setting-yaml-logging.quiet` is ``no/false``, :ref:`setting-yaml-logging.loglevel` will be minimally set to ``6 (info)``.
 
 .. _setting-yaml-logging.protobuf_use_kernel_timestamp:
 
index 10469fb445080a6669b3f087af6201f1aead4fc1..2769e9e2ccc7387be99685908e3d179f6dddf4b3 100644 (file)
@@ -3282,9 +3282,6 @@ int main(int argc, char** argv)
     g_slogStructured = ::arg().mustDo("structured-logging");
     s_structured_logger_backend = ::arg()["structured-logging-backend"];
 
-    if (s_logUrgency < Logger::Error) {
-      s_logUrgency = Logger::Error;
-    }
     if (!g_quiet && s_logUrgency < Logger::Info) { // Logger::Info=6, Logger::Debug=7
       s_logUrgency = Logger::Info; // if you do --quiet=no, you need Info to also see the query log
     }
index e57ea13940b1a27d016113a370cbe26eada23592..127603bb1ca90b2192d10e36e23eca112044a859 100644 (file)
@@ -1238,11 +1238,13 @@ This feature is intended to facilitate ip-failover setups, but it may also mask
         'help' : 'Amount of logging. Higher is more. Do not set below 3',
         'doc' : '''
 Amount of logging. The higher the number, the more lines logged.
-Corresponds to 'syslog' level values (e.g. 0 = emergency, 1 = alert, 2 = critical, 3 = error, 4 = warning, 5 = notice, 6 = info, 7 = debug).
+Corresponds to ``syslog`` level values (e.g. 0 = ``emergency``, 1 = ``alert``, 2 = ``critical``, 3 = ``error``, 4 = ``warning``, 5 = ``notice``, 6 = ``info``, 7 = ``debug``).
 Each level includes itself plus the lower levels before it.
 Not recommended to set this below 3.
+If :ref:`setting-quiet` is ``no/false``, :ref:`setting-loglevel` will be minimally set to ``6 (info)``.
  ''',
-    },    
+        'versionchanged': ('5.0.0', 'Previous version would not allow setting a level below ``3 (error)``.')
+    },
     {
         'name' : 'common_errors',
         'section' : 'logging',