diff options
author | Steven Hiscocks <steven@hiscocks.me.uk> | 2014-06-09 22:17:00 +0100 |
---|---|---|
committer | Steven Hiscocks <steven@hiscocks.me.uk> | 2014-06-09 22:17:00 +0100 |
commit | e8131475cd34b95a34b84c2b949b808f48d90a5f (patch) | |
tree | 1243a6f9eb8142701484142ca36223b3963a9f5d /fail2ban/helpers.py | |
parent | db023be09bae14b3ae23b476791bed79d6e71e36 (diff) | |
download | fail2ban-e8131475cd34b95a34b84c2b949b808f48d90a5f.tar.gz |
ENH: Realign and harmonise log messages with getF2BLogger helper
Diffstat (limited to 'fail2ban/helpers.py')
-rw-r--r-- | fail2ban/helpers.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fail2ban/helpers.py b/fail2ban/helpers.py index 2579381d..c3e50336 100644 --- a/fail2ban/helpers.py +++ b/fail2ban/helpers.py @@ -107,3 +107,8 @@ class FormatterWithTraceBack(logging.Formatter): def format(self, record): record.tbc = record.tb = self._tb() return logging.Formatter.format(self, record) + +def getF2BLogger(name): + """Get logging.Logger instance with Fail2Ban logger name convention + """ + return logging.getLogger("fail2ban.%s" % name.rpartition(".")[-1]) |