Message401089
Using the format option for Python logging works fine on all windows machines:
logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.DEBUG,format='%(asctime)s : %(message)s ')
But error occurs on Linux mint 64 20.2 using Python 3.8 when the % symbol in the format causes a problem.
Traceback (most recent call last):
File "/usr/lib/python3.8/idlelib/run.py", line 559, in runcode
exec(code, self.locals)
File "/media/victor/B694-5211/python now git/prototype server3.py", line 14, in
logging.basicConfig(filename='log.log', encoding='utf-8', level=logging.DEBUG,format='%(asctime)s:%(message)s')
File "/usr/lib/python3.8/logging/init.py", line 2009, in basicConfig
raise ValueError('Unrecognised argument(s): %s' % keys)
ValueError: Unrecognised argument(s): encoding |
|
Date |
User |
Action |
Args |
2021-09-05 15:53:18 | andrewsuttle56 | set | recipients:
+ andrewsuttle56 |
2021-09-05 15:53:18 | andrewsuttle56 | set | messageid: <1630857198.47.0.486193642329.issue45106@roundup.psfhosted.org> |
2021-09-05 15:53:18 | andrewsuttle56 | link | issue45106 messages |
2021-09-05 15:53:18 | andrewsuttle56 | create | |
|