FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
cpython/Lib/test/support/logging_helper.py at master · python-emscripten/cpython · GitHub
python-emscripten
cpython
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
cpython
/
Lib
/
test
/
support
/
logging_helper.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
29 lines (25 loc) · 916 Bytes
Breadcrumbs
cpython
/
Lib
/
test
/
support
/
logging_helper.py
Copy path
File metadata and controls
29 lines (25 loc) · 916 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import
logging
.
handlers
class
TestHandler
(
logging
.
handlers
.
BufferingHandler
):
def
__init__
(
self
,
matcher
):
# BufferingHandler takes a "capacity" argument
# so as to know when to flush. As we're overriding
# shouldFlush anyway, we can set a capacity of zero.
# You can call flush() manually to clear out the
# buffer.
logging
.
handlers
.
BufferingHandler
.
__init__
(
self
,
0
)
self
.
matcher
=
matcher
def
shouldFlush
(
self
):
return
False
def
emit
(
self
,
record
):
self
.
format
(
record
)
self
.
buffer
.
append
(
record
.
__dict__
)
def
matches
(
self
,
**
kwargs
):
"""
Look for a saved dict whose keys/values match the supplied arguments.
"""
result
=
False
for
d
in
self
.
buffer
:
if
self
.
matcher
.
matches
(
d
,
**
kwargs
):
result
=
True
break
return
result
Back
|
FazBrowse Home
|
New Git URL