logfile nor optional

This commit is contained in:
2026-03-10 13:42:59 +01:00
parent ffd296ef99
commit 927a18e64b
2 changed files with 22 additions and 14 deletions

View File

@@ -4,6 +4,7 @@ Setup for the logging of eos.
import sys
import logging
import logging.handlers
from .options import ReflectivityOutputConfig
def setup_logging():
logger = logging.getLogger() # logging.getLogger('quicknxs')
@@ -19,19 +20,26 @@ def setup_logging():
console.setLevel(logging.WARNING)
logger.addHandler(console)
# if os.path.exists('amor_eos.log'):
# rollover = True
# else:
# rollover = False
logfile = logging.handlers.RotatingFileHandler('amor_eos.log', encoding='utf8', mode='w',
maxBytes=200*1024**2, backupCount=20)
# if rollover: logfile.doRollover()
formatter = logging.Formatter(
'[%(levelname).4s] - %(asctime)s - %(filename)s:%(lineno)i:%(funcName)s %(message)s',
'')
logfile.setFormatter(formatter)
logfile.setLevel(logging.DEBUG)
logger.addHandler(logfile)
if ReflectivityOutputConfig.logFile:
# if os.path.exists('amor_eos.log'):
# rollover = True
# else:
# rollover = False
logfile = logging.handlers.RotatingFileHandler(
'amor_eos.log',
encoding='utf8',
mode='w',
maxBytes=200*1024**2,
backupCount=20,
)
# if rollover: logfile.doRollover()
formatter = logging.Formatter(
'[%(levelname).4s] - %(asctime)s - %(filename)s:%(lineno)i:%(funcName)s %(message)s',
'',
)
logfile.setFormatter(formatter)
logfile.setLevel(logging.DEBUG)
logger.addHandler(logfile)
def update_loglevel(verbose=0):
if verbose==1:

View File

@@ -530,7 +530,7 @@ class ReflectivityOutputConfig(ArgParsable):
default = False,
metadata = {
'group': 'output',
'help': 'write log file "eos.log"',
'help': 'write log file "amor_eos.log"',
}
)
plot: bool = field(