Skip to content
This repository was archived by the owner on Jun 28, 2023. It is now read-only.

Commit fa8ad72

Browse files
committed
Use logging module for build_doc
1 parent 02941b0 commit fa8ad72

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

build_doc.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
#!/usr/bin/env python3
22

33
from subprocess import check_output
4+
import logging
5+
6+
7+
logging.basicConfig(format='{levelname}:{message}',
8+
style='{',
9+
level=logging.DEBUG)
410

511
DOCUMENT_FOLDER = 'doc'
612
API_DOCUMENT_FOLDER = '{}/{}'.format(DOCUMENT_FOLDER, 'api')
@@ -10,9 +16,10 @@
1016

1117

1218
def run_cmd(cmd):
13-
print('running command: {}'.format(cmd))
14-
result = check_output(cmd.split())
15-
print(result.decode(), end='')
19+
logging.info('command: {}'.format(cmd))
20+
result = check_output(cmd.split()).strip()
21+
if result:
22+
logging.debug(result.decode())
1623
return result
1724

1825

0 commit comments

Comments
 (0)