Remove verbose logging implementation

This commit is contained in:
Veronica Berglyd Olsen
2022-10-19 08:29:02 +02:00
parent 8775b360d8
commit e52f0a9e16
2 changed files with 0 additions and 37 deletions
-31
View File
@@ -72,32 +72,6 @@ __helpurl__ = "https://github.com/vkbo/novelWriter/discussions"
__releaseurl__ = "https://github.com/vkbo/novelWriter/releases/latest"
__docurl__ = "https://novelwriter.readthedocs.io"
##
# Logging
# =========
# Standard used for logging levels in novelWriter:
# CRITICAL Use for errors that result in termination of the program
# ERROR Use when an action fails, but execution continues
# WARNING When something unexpected, but non-critical happens
# INFO Any useful user information like open, save, exit initiated
# ----------- SPAM Threshold : Output above should be minimal -----------------
# DEBUG Use for descriptions of main program flow
# VERBOSE Use for outputting values and program flow details
##
# Add verbose logging level
VERBOSE = 5
logging.addLevelName(VERBOSE, "VERBOSE")
def logVerbose(self, message, *args, **kws):
if self.isEnabledFor(VERBOSE):
self._log(VERBOSE, message, args, **kws)
logging.Logger.verbose = logVerbose
# Initiating logging
logger = logging.getLogger(__name__)
@@ -122,7 +96,6 @@ def main(sysArgs=None):
"version",
"info",
"debug",
"verbose",
"style=",
"config=",
"data=",
@@ -143,7 +116,6 @@ def main(sysArgs=None):
" -v, --version Print program version and exit.\n"
" --info Print additional runtime information.\n"
" --debug Print debug output. Includes --info.\n"
" --verbose Increase verbosity of debug output. Includes --debug.\n"
" --style= Sets Qt5 style flag. Defaults to 'Fusion'.\n"
" --config= Alternative config file.\n"
" --data= Alternative user data path.\n"
@@ -181,9 +153,6 @@ def main(sysArgs=None):
elif inOpt == "--debug":
logLevel = logging.DEBUG
logFormat = "[{asctime:}] {filename:>17}:{lineno:<4d} {levelname:8} {message:}"
elif inOpt == "--verbose":
logLevel = VERBOSE
logFormat = "[{asctime:}] {filename:>17}:{lineno:<4d} {levelname:8} {message:}"
elif inOpt == "--style":
qtStyle = inArg
elif inOpt == "--config":
-6
View File
@@ -111,12 +111,6 @@ def testBaseInit_Options(monkeypatch, tmpDir):
assert novelwriter.logger.getEffectiveLevel() == logging.DEBUG
assert nwGUI.closeMain() == "closeMain"
nwGUI = novelwriter.main(
["--testmode", "--verbose", "--config=%s" % tmpDir, "--data=%s" % tmpDir]
)
assert novelwriter.logger.getEffectiveLevel() == 5
assert nwGUI.closeMain() == "closeMain"
# Help and Version
with pytest.raises(SystemExit) as ex:
nwGUI = novelwriter.main(