Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
6c8f94a9
Commit
6c8f94a9
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-699
: remove leading whitespace when removing lineseps as well
parent
8801accb
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
LCS/Messaging/python/messagelogger/messagelogger.py
+5
-2
5 additions, 2 deletions
LCS/Messaging/python/messagelogger/messagelogger.py
with
5 additions
and
2 deletions
LCS/Messaging/python/messagelogger/messagelogger.py
+
5
−
2
View file @
6c8f94a9
...
@@ -24,7 +24,7 @@
...
@@ -24,7 +24,7 @@
Simple buslistener logging each and every received message
Simple buslistener logging each and every received message
"""
"""
from
os
import
linesep
import
re
import
logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -45,7 +45,10 @@ class MessageLogger(BusListener):
...
@@ -45,7 +45,10 @@ class MessageLogger(BusListener):
content
=
str
(
msg
.
content
)
content
=
str
(
msg
.
content
)
if
self
.
_remove_content_newlines
:
if
self
.
_remove_content_newlines
:
content
=
content
.
replace
(
linesep
,
"
"
)
linesep_whitespace
=
re
.
compile
(
"
\n
\s\s
"
)
while
linesep_whitespace
.
match
(
content
):
content
=
linesep_whitespace
.
sub
(
"
\n
"
)
content
=
content
.
replace
(
"
\n
"
,
"
"
)
if
self
.
_max_content_size
>
0
and
len
(
content
)
>
self
.
_max_content_size
:
if
self
.
_max_content_size
>
0
and
len
(
content
)
>
self
.
_max_content_size
:
content
=
content
[:
self
.
_max_content_size
]
+
"
...
"
content
=
content
[:
self
.
_max_content_size
]
+
"
...
"
...
...
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