Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hidra
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
steinbac
hidra
Commits
7c1791ab
Commit
7c1791ab
authored
9 years ago
by
Manuela Kuhn
Browse files
Options
Downloads
Patches
Plain Diff
Parameter to display messages on screen is case-insensitive
parent
f2b55de1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/shared/helperScript.py
+7
-6
7 additions, 6 deletions
src/shared/helperScript.py
with
7 additions
and
6 deletions
src/shared/helperScript.py
+
7
−
6
View file @
7c1791ab
...
...
@@ -259,13 +259,14 @@ def initLogging(filenameFullPath, verbose, onScreenLogLevel = False):
#log info to stdout, display messages with different format than the file output
if onScreenLogLevel:
if onScreenLogLevel in [
"
DEBUG
"
,
"
INFO
"
,
"
WARNING
"
,
"
ERROR
"
,
"
CRITICAL
"
]:
onScreenLogLevelLower = onScreenLogLevel.lower()
if onScreenLogLevelLower in [
"
debug
"
,
"
info
"
,
"
warning
"
,
"
error
"
,
"
critical
"
]:
console = logging.StreamHandler()
screenHandlerFormat = logging.Formatter(datefmt =
"
%
Y
-%
m
-%
d_
%
H
:
%
M
:
%
S
"
,
fmt =
"
[
%
(
asctime
)
s
]
>
%
(
message
)
s
"
)
if onScreenLogLevel
==
"
DEBUG
"
:
if onScreenLogLevel
Lower ==
"
debug
"
:
screenLoggingLevel = logging.DEBUG
console.setLevel(screenLoggingLevel)
...
...
@@ -274,16 +275,16 @@ def initLogging(filenameFullPath, verbose, onScreenLogLevel = False):
if not verbose:
logging.error(
"
Logging
on
Screen
:
Option
DEBUG
in
only
active
when
using
verbose
option
as
well
(
Fallback
to
INFO
).
"
)
elif onScreenLogLevel ==
"
INFO
"
:
elif onScreenLogLevel
Lower
==
"
info
"
:
screenLoggingLevel = logging.INFO
console.setLevel(screenLoggingLevel)
elif onScreenLogLevel
==
"
WARNING
"
:
elif onScreenLogLevel
Lower ==
"
warning
"
:
screenLoggingLevel = logging.WARNING
console.setLevel(screenLoggingLevel)
elif onScreenLogLevel
==
"
ERROR
"
:
elif onScreenLogLevel
Lower ==
"
error
"
:
screenLoggingLevel = logging.ERROR
console.setLevel(screenLoggingLevel)
elif onScreenLogLevel
==
"
CRITICAL
"
:
elif onScreenLogLevel
Lower ==
"
critical
"
:
screenLoggingLevel = logging.CRITICAL
console.setLevel(screenLoggingLevel)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment