5
5
6
6
from cPyExtPatt .Logging import cLogging
7
7
8
- logging .basicConfig (level = logging .DEBUG , stream = sys .stdout )
8
+ #: Default log format (terse)
9
+ DEFAULT_OPT_LOG_FORMAT = '%(asctime)s %(process)d %(levelname)-8s %(message)s'
10
+ #: Default log format (verbose)
11
+ DEFAULT_OPT_LOG_FORMAT_VERBOSE = '%(asctime)s - %(filename)-16s#%(lineno)-4d - %(process)5d - (%(threadName)-10s) - %(levelname)-8s - %(message)s'
12
+
13
+ logging .basicConfig (level = logging .DEBUG , stream = sys .stderr , format = DEFAULT_OPT_LOG_FORMAT )
14
+
15
+ logger = logging .getLogger (__file__ )
16
+
17
+
18
+ def _test_logging ():
19
+ logger .setLevel (logging .DEBUG )
20
+ logger .warning ('Test warning message XXXX' )
21
+ logger .debug ('Test debug message XXXX' )
22
+ assert 0
9
23
10
24
11
25
def test_c_logging_dir ():
@@ -30,30 +44,30 @@ def test_c_logging_dir():
30
44
]
31
45
32
46
33
- def test_c_logging_log ():
47
+ def _test_c_logging_log ():
34
48
print ()
35
49
cLogging .py_log_set_level (10 )
36
50
result = cLogging .log (cLogging .ERROR , "Test log message" )
37
51
assert result is not None
38
52
39
53
40
- def test_c_file_line_function_file ():
54
+ def _test_c_file_line_function_file ():
41
55
file , line , function = cLogging .c_file_line_function ()
42
56
assert file == 'src/cpy/Logging/cLogging.c'
43
57
assert line == 148
44
58
assert function == 'c_file_line_function'
45
59
46
60
47
- def test_py_file_line_function_file ():
61
+ def _test_py_file_line_function_file ():
48
62
file , _line , _function = cLogging .py_file_line_function ()
49
63
assert file == __file__
50
64
51
65
52
- def test_py_file_line_function_line ():
66
+ def _test_py_file_line_function_line ():
53
67
_file , line , _function = cLogging .py_file_line_function ()
54
68
assert line == 50
55
69
56
70
57
- def test_py_file_line_function_function ():
71
+ def _test_py_file_line_function_function ():
58
72
_file , _line , function = cLogging .py_file_line_function ()
59
73
assert function == 'test_py_file_line_function_function'
0 commit comments