[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [gettor/master] Set default log level for gettor to "info"



commit b8d228adc2d24891e49d53d62ff93f7b45041cc2
Author: Cecylia Bocovich <cohosh@xxxxxxxxxxxxxx>
Date:   Wed Apr 29 14:12:34 2020 -0400

    Set default log level for gettor to "info"
---
 gettor/utils/commons.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/gettor/utils/commons.py b/gettor/utils/commons.py
index b769efc..981a21b 100644
--- a/gettor/utils/commons.py
+++ b/gettor/utils/commons.py
@@ -10,11 +10,13 @@
 #
 # :license: This is Free Software. See LICENSE for license information.
 
-from twisted.logger import Logger
+from twisted.logger import Logger, LogLevel
+from twisted.logger import FilteringLogObserver, LogLevelFilterPredicate
 from twisted.application import internet
-
 # Define an application logger
 log = Logger(namespace="gettor")
+predicate = LogLevelFilterPredicate(defaultLogLevel=LogLevel.info)
+log.observer = FilteringLogObserver(log.observer, [predicate])
 
 class BaseService(internet.TimerService):
     """



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits