diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-08-27 15:50:10 +0200 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2024-08-27 15:50:10 +0200 |
commit | 79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5 (patch) | |
tree | 1a1e7ab8a8a4b703f3237d2ed77ed9f60a2d42fd /ayatanasettings/logger.py | |
parent | 4bfbd579171d9194956376c7153f378ff6eb9d4e (diff) | |
parent | 1398450b47460ae951f69e410311677cb8fc14a7 (diff) | |
download | ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.tar.gz ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.tar.bz2 ayatana-settings-79853595a8e4adacddaeffd42f8e4cfdf5f9a5c5.zip |
Merge branch 'pr/full-rewrite'
Attributes GH PR #25: https://github.com/AyatanaIndicators/ayatana-settings/pull/25
Diffstat (limited to 'ayatanasettings/logger.py')
-rw-r--r-- | ayatanasettings/logger.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/ayatanasettings/logger.py b/ayatanasettings/logger.py deleted file mode 100644 index 4b8763e..0000000 --- a/ayatanasettings/logger.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -import logging -from .appdata import APPNAME - -class Formatter(logging.Formatter): - - def __init__(self): - - logging.Formatter.__init__(self, '[%(asctime)s] %(levelname)s: %(message)s') - self.default_msec_format = '%s.%03d' - - def format(self, record): - - dColours = {'WARNING': '33', 'INFO': '32', 'DEBUG': '37', 'CRITICAL': '35', 'ERROR': '31'} - record.levelname = '\033[1;' + dColours[record.levelname] + 'm' + record.levelname + '\033[0m' - - return logging.Formatter.format(self, record) - -logger = logging.getLogger(APPNAME) -logger.setLevel(logging.DEBUG) -pStreamHandler = logging.StreamHandler() -pStreamHandler.setFormatter(Formatter()) -logger.addHandler(pStreamHandler) |