Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
ZODB
Commits
f3323e1d
Commit
f3323e1d
authored
Apr 09, 2004
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
logging configuration is evil; isolate it
parent
61a3376b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
22 deletions
+27
-22
test.py
test.py
+27
-22
No files found.
test.py
View file @
f3323e1d
...
@@ -603,32 +603,10 @@ def main(module_filter, test_filter, libdir):
...
@@ -603,32 +603,10 @@ def main(module_filter, test_filter, libdir):
if
not
keepStaleBytecode
:
if
not
keepStaleBytecode
:
os
.
path
.
walk
(
os
.
curdir
,
remove_stale_bytecode
,
None
)
os
.
path
.
walk
(
os
.
curdir
,
remove_stale_bytecode
,
None
)
# Get the log.ini file from the current directory instead of possibly
# buried in the build directory. XXX This isn't perfect because if
# log.ini specifies a log file, it'll be relative to the build directory.
# Hmm...
logini
=
os
.
path
.
abspath
(
"log.ini"
)
# Initialize the path and cwd
# Initialize the path and cwd
global
pathinit
global
pathinit
pathinit
=
PathInit
(
build
,
build_inplace
,
libdir
)
pathinit
=
PathInit
(
build
,
build_inplace
,
libdir
)
# Initialize the logging module.
import
logging.config
logging
.
basicConfig
()
level
=
os
.
getenv
(
"LOGGING"
)
if
level
:
level
=
int
(
level
)
else
:
level
=
logging
.
CRITICAL
logging
.
root
.
setLevel
(
level
)
if
os
.
path
.
exists
(
logini
):
# Hack: The ZEO tests need to pass the logging config to spawned
# processes. I can't think of a better way to do it than using
# environment variables.
os
.
environ
[
"LOGINI"
]
=
logini
logging
.
config
.
fileConfig
(
logini
)
files
=
find_tests
(
module_filter
)
files
=
find_tests
(
module_filter
)
files
.
sort
()
files
.
sort
()
...
@@ -653,6 +631,33 @@ def main(module_filter, test_filter, libdir):
...
@@ -653,6 +631,33 @@ def main(module_filter, test_filter, libdir):
runner
(
files
,
test_filter
,
debug
)
runner
(
files
,
test_filter
,
debug
)
def
configure_logging
():
"""Initialize the logging module."""
import
logging.config
# Get the log.ini file from the current directory instead of possibly
# buried in the build directory. XXX This isn't perfect because if
# log.ini specifies a log file, it'll be relative to the build directory.
# Hmm...
logini
=
os
.
path
.
abspath
(
"log.ini"
)
if
os
.
path
.
exists
(
logini
):
logging
.
config
.
fileConfig
(
logini
)
else
:
logging
.
basicConfig
()
if
os
.
environ
.
has_key
(
"LOGGING"
):
level
=
int
(
os
.
environ
[
"LOGGING"
])
logging
.
getLogger
().
setLevel
(
level
)
if
os
.
path
.
exists
(
logini
):
# Hack: The ZEO tests need to pass the logging config to
# spawned processes. We haven't thought of a better way to do
# it than using environment variables.
os
.
environ
[
"LOGINI"
]
=
logini
logging
.
config
.
fileConfig
(
logini
)
def
process_args
(
argv
=
None
):
def
process_args
(
argv
=
None
):
import
getopt
import
getopt
import
warnings
import
warnings
...
...
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