Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
bcfa5cd0
Commit
bcfa5cd0
authored
8 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Add an option to disable stdio redirect
This makes it tractable to run synapse under pdb.
parent
d84bd51e
Loading
Loading
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/config/logger.py
+12
-1
12 additions, 1 deletion
synapse/config/logger.py
with
12 additions
and
1 deletion
synapse/config/logger.py
+
12
−
1
View file @
bcfa5cd0
...
...
@@ -68,6 +68,7 @@ class LoggingConfig(Config):
def
read_config
(
self
,
config
):
self
.
verbosity
=
config
.
get
(
"
verbose
"
,
0
)
self
.
no_redirect_stdio
=
config
.
get
(
"
no_redirect_stdio
"
,
False
)
self
.
log_config
=
self
.
abspath
(
config
.
get
(
"
log_config
"
))
self
.
log_file
=
self
.
abspath
(
config
.
get
(
"
log_file
"
))
...
...
@@ -90,6 +91,8 @@ class LoggingConfig(Config):
def
read_arguments
(
self
,
args
):
if
args
.
verbose
is
not
None
:
self
.
verbosity
=
args
.
verbose
if
args
.
no_redirect_stdio
is
not
None
:
self
.
no_redirect_stdio
=
args
.
no_redirect_stdio
if
args
.
log_config
is
not
None
:
self
.
log_config
=
args
.
log_config
if
args
.
log_file
is
not
None
:
...
...
@@ -109,6 +112,11 @@ class LoggingConfig(Config):
'
--log-config
'
,
dest
=
"
log_config
"
,
default
=
None
,
help
=
"
Python logging config file
"
)
logging_group
.
add_argument
(
'
-n
'
,
'
--no-redirect-stdio
'
,
action
=
'
store_true
'
,
default
=
None
,
help
=
"
Do not redirect stdout/stderr to the log
"
)
def
generate_files
(
self
,
config
):
log_config
=
config
.
get
(
"
log_config
"
)
...
...
@@ -194,4 +202,7 @@ def setup_logging(config, use_worker_options=False):
#
# However this may not be too much of a problem if we are just writing to a file.
observer
=
STDLibLogObserver
()
globalLogBeginner
.
beginLoggingTo
([
observer
])
globalLogBeginner
.
beginLoggingTo
(
[
observer
],
redirectStandardIO
=
not
config
.
no_redirect_stdio
,
)
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