Skip to content

Commit 9648aa2

Browse files
committed
fix docs
1 parent 882582c commit 9648aa2

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

README.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,10 @@ testgres supports [python logging](https://docs.python.org/3.6/library/logging.h
4848
which means that you can aggregate logs from several nodes into one file:
4949

5050
```python
51-
import io
5251
import logging
5352

5453
# 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')
5855

5956
# create two different nodes with logging
6057
node1 = testgres.get_new_node('node1', use_logging=True).init().start()
@@ -71,8 +68,6 @@ node2.execute('postgres', 'select 2')
7168
Here is an example of what you can do with `testgres`:
7269

7370
```python
74-
import testgres
75-
7671
with testgres.get_new_node('test') as node:
7772
node.init() # run initdb
7873
node.start() # start PostgreSQL

0 commit comments

Comments
 (0)