Skip to content

Commit 7dc4c2d

Browse files
committed
ovl: add a flag for debug
1 parent c1b330c commit 7dc4c2d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

py/ovl.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
_CERT_DIR = os.path.expanduser('~/.config/ovl')
4343

44+
_DEBUG = False
4445
_ESCAPE = '~'
4546
_BUFSIZ = 8192
4647
_DEFAULT_HTTPS_PORT = 443
@@ -377,8 +378,9 @@ def StartRPCServer(self):
377378

378379
pid = os.fork()
379380
if pid == 0:
380-
for fd in range(3):
381-
os.close(fd)
381+
if not _DEBUG:
382+
for fd in range(3):
383+
os.close(fd)
382384
self._server.serve_forever()
383385

384386
@staticmethod
@@ -1768,7 +1770,8 @@ def main():
17681770
except KeyboardInterrupt:
17691771
print('Ctrl-C received, abort')
17701772
except Exception as e:
1771-
logging.exception(e)
1773+
if _DEBUG:
1774+
logging.exception(e)
17721775
print(f'error: {str(e)}')
17731776

17741777

0 commit comments

Comments
 (0)