diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2024-01-19 21:15:17 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-09-04 00:27:30 +0200 |
commit | 13bac75a24e98c7b8a8c88bbd9050b9be573ad42 (patch) | |
tree | 7475e7fd9e17575c2281dbae3f3b15dcc6657e58 /src | |
parent | 6b1044b37dce83d6930a17237a891ee00c6875d1 (diff) | |
download | wikipediafs-13bac75a24e98c7b8a8c88bbd9050b9be573ad42.tar.gz |
WIP: some logging
Diffstat (limited to 'src')
-rwxr-xr-x | src/mount.wikipediafs | 2 | ||||
-rw-r--r-- | src/wikipediafs/fs.py | 3 | ||||
-rw-r--r-- | src/wikipediafs/logger.py | 1 |
3 files changed, 5 insertions, 1 deletions
diff --git a/src/mount.wikipediafs b/src/mount.wikipediafs index 50d7541..d31b31d 100755 --- a/src/mount.wikipediafs +++ b/src/mount.wikipediafs @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- # WikipediaFS diff --git a/src/wikipediafs/fs.py b/src/wikipediafs/fs.py index 8e8ee6d..0c82149 100644 --- a/src/wikipediafs/fs.py +++ b/src/wikipediafs/fs.py @@ -165,6 +165,9 @@ class Root: self.regexp = re.compile(self.regexp, re.IGNORECASE) for dirname, config in list(CONFIG.sites.items()): + LOGGER.debug('dirname = %s (%s)', dirname, type(dirname)) + if isinstance(dirname, bytes): + dirname = str(dirname) self.dirs[dirname] = True self.fs.set_dir("/" + dirname, ArticleDir(self.fs, config)) diff --git a/src/wikipediafs/logger.py b/src/wikipediafs/logger.py index 4c39b91..64f10be 100644 --- a/src/wikipediafs/logger.py +++ b/src/wikipediafs/logger.py @@ -34,6 +34,7 @@ formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s') hdlr.setFormatter(formatter) LOGGER.addHandler(hdlr) +LOGGER.info('CONFIG.debug_mode = %s', CONFIG.debug_mode) if CONFIG.debug_mode: LOGGER.setLevel(logging.DEBUG) else: |