Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
0906d212
Unverified
Commit
0906d212
authored
Jul 24, 2023
by
Arthur
Committed by
GitHub
Jul 24, 2023
Browse files
[`logging.py`] set default `stderr` path if `None` (#25033)
set default logger
parent
c9a82be5
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
src/transformers/utils/logging.py
src/transformers/utils/logging.py
+4
-0
No files found.
src/transformers/utils/logging.py
View file @
0906d212
...
@@ -85,6 +85,10 @@ def _configure_library_root_logger() -> None:
...
@@ -85,6 +85,10 @@ def _configure_library_root_logger() -> None:
# This library has already configured the library root logger.
# This library has already configured the library root logger.
return
return
_default_handler
=
logging
.
StreamHandler
()
# Set sys.stderr as stream.
_default_handler
=
logging
.
StreamHandler
()
# Set sys.stderr as stream.
# set defaults based on https://github.com/pyinstaller/pyinstaller/issues/7334#issuecomment-1357447176
if
sys
.
stderr
is
None
:
sys
.
stderr
=
open
(
os
.
devnull
,
"w"
)
_default_handler
.
flush
=
sys
.
stderr
.
flush
_default_handler
.
flush
=
sys
.
stderr
.
flush
# Apply our default configuration to the library root logger.
# Apply our default configuration to the library root logger.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment