File tree Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Expand file tree Collapse file tree 1 file changed +1
-6
lines changed Original file line number Diff line number Diff line change @@ -48,13 +48,10 @@ testgres supports [python logging](https://docs.python.org/3.6/library/logging.h
48
48
which means that you can aggregate logs from several nodes into one file:
49
49
50
50
``` python
51
- import io
52
51
import logging
53
52
54
53
# write everything to /tmp/testgres.log
55
- logfile = io.open(' /tmp/testgres.log' , ' w' )
56
- logger = logging.getLogger(' testgres' )
57
- logger.FileHandler(logfile)
54
+ logging.basicConfig(filename = ' /tmp/testgres.log' )
58
55
59
56
# create two different nodes with logging
60
57
node1 = testgres.get_new_node(' node1' , use_logging = True ).init().start()
@@ -71,8 +68,6 @@ node2.execute('postgres', 'select 2')
71
68
Here is an example of what you can do with ` testgres ` :
72
69
73
70
``` python
74
- import testgres
75
-
76
71
with testgres.get_new_node(' test' ) as node:
77
72
node.init() # run initdb
78
73
node.start() # start PostgreSQL
You can’t perform that action at this time.
0 commit comments