Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CastorScript
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
atlas-tdaq-software
CastorScript
Commits
f27d8fe6
Commit
f27d8fe6
authored
6 years ago
by
Jonas
Browse files
Options
Downloads
Patches
Plain Diff
Added: Todo's for future issue
parent
3bfca133
No related branches found
No related tags found
1 merge request
!23
Resolve "Logging implementation cleanup"
Pipeline
#755199
failed
6 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Script/CastorScript.py
+2
-0
2 additions, 0 deletions
Script/CastorScript.py
Script/cs/Threads/CheckThread.py
+7
-0
7 additions, 0 deletions
Script/cs/Threads/CheckThread.py
with
9 additions
and
0 deletions
Script/CastorScript.py
+
2
−
0
View file @
f27d8fe6
...
...
@@ -115,8 +115,10 @@ def main(conf):
from
ispy
import
IPCPartition
#pylint: disable=no-name-in-module
IPCPartition
=
IPCPartition
()
#ers.addLoggingHandler("main")
#TODO rename main_ERS_handler to ers_handler
main_ERS_handler
=
ers
.
LoggingHandler
()
set_log_level
(
conf
.
ERSLogLevel
,
main_ERS_handler
)
#TODO attach ers handler to root logger instead of "main" logger
logging
.
getLogger
(
"
main
"
).
addHandler
(
main_ERS_handler
)
logger
.
info
(
"
CastorScript is now logging to partition
'
%s
'"
,
conf
.
partition
)
...
...
This diff is collapsed.
Click to expand it.
Script/cs/Threads/CheckThread.py
+
7
−
0
View file @
f27d8fe6
...
...
@@ -24,6 +24,7 @@ class CheckThread(threading.Thread):
self
.
delete
=
delete
##### Main logger #####
#TODO remove mainLogger (only root logger is needed and there is no need to store it locally)
self
.
mainLogger
=
logging
.
getLogger
(
'
main
'
)
self
.
main_ERS_handler
=
mainERSHandler
...
...
@@ -42,6 +43,8 @@ class CheckThread(threading.Thread):
##### Set Logger for CheckThread #####
self
.
logFile
=
os
.
path
.
join
(
self
.
LogDir
,
'
CheckLog.out
'
)
# TODO rename all handlers (they are not loggers)
# TODO there is no need to store them in the object (double check) (make them local variables)
self
.
CheckLog
=
logging
.
FileHandler
(
self
.
logFile
,
'
w
'
)
self
.
CheckLog
.
setFormatter
(
formatter
)
...
...
@@ -54,6 +57,7 @@ class CheckThread(threading.Thread):
##### Add ERS handler #####
if
self
.
ERSenabled
:
try
:
#TODO remove: we don't need another ers handler, just use the central one
self
.
check_ERS_handler
=
ers
.
LoggingHandler
()
set_log_level
(
self
.
ERSLogLevel
,
self
.
check_ERS_handler
)
self
.
logger
.
addHandler
(
self
.
check_ERS_handler
)
...
...
@@ -64,6 +68,7 @@ class CheckThread(threading.Thread):
def
run
(
self
):
#TODO log thread id to local logger and not mainLogger
self
.
mainLogger
.
info
(
thread_id_string
())
...
...
@@ -97,6 +102,7 @@ class CheckThread(threading.Thread):
def
change_state_ers
(
self
,
create_ers_handler
):
if
create_ers_handler
:
##### Add ERS handler to all loggers #####
#TODO this should be the root logger
self
.
mainLogger
.
addHandler
(
self
.
main_ERS_handler
)
self
.
logger
.
addHandler
(
self
.
check_ERS_handler
)
self
.
copy
.
AddRemoveERS
(
True
)
...
...
@@ -105,6 +111,7 @@ class CheckThread(threading.Thread):
self
.
delete
.
AddRemoveERS
(
True
)
else
:
##### Remove ERS from all loggers #####
#TODO this should be the root logger
self
.
mainLogger
.
removeHandler
(
self
.
main_ERS_handler
)
self
.
logger
.
removeHandler
(
self
.
check_ERS_handler
)
self
.
copy
.
AddRemoveERS
(
False
)
...
...
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