Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DG_PY_FOFBTool
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DG
DS_DG_PyTango_Package
DG_PY_FOFBTool
Commits
0c696e90
Commit
0c696e90
authored
11 months ago
by
Samuel GARNIER
Browse files
Options
Downloads
Patches
Plain Diff
Upgrade the log format
parent
5029daf9
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
DG_PY_FOFBTool.py
+4
-3
4 additions, 3 deletions
DG_PY_FOFBTool.py
with
4 additions
and
3 deletions
DG_PY_FOFBTool.py
+
4
−
3
View file @
0c696e90
...
...
@@ -29,12 +29,12 @@ import FofbTool.Configuration
import
logging
import
numpy
as
np
class
ds_logappender
(
logging
.
Handler
):
class
ds_logappender
(
logging
.
Stream
Handler
):
def
__init__
(
self
,
parent
):
self
.
parent
=
parent
logging
.
Handler
.
__init__
(
self
=
self
)
logging
.
Stream
Handler
.
__init__
(
self
=
self
)
def
emit
(
self
,
record
):
self
.
parent
.
_logs
=
[
record
.
getMessage
(
),]
+
self
.
parent
.
_logs
[:
-
1
]
self
.
parent
.
_logs
=
[
self
.
format
(
record
),]
+
self
.
parent
.
_logs
[:
-
1
]
#----- PROTECTED REGION END -----# // DG_PY_FOFBTool.additionnal_import
...
...
@@ -216,6 +216,7 @@ class DG_PY_FOFBTool(Device):
logger
=
logging
.
getLogger
(
"
FofbTool
"
)
la
=
ds_logappender
(
self
)
la
.
setFormatter
(
logging
.
Formatter
(
"
{asctime} {levelname:8}: {message}
"
,
style
=
'
{
'
))
logger
.
addHandler
(
la
)
logger
.
setLevel
(
getattr
(
logging
,
self
.
loglevel
.
upper
()))
...
...
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