From 1243b4aea73fe46dc8e98ea0318d1eadbd2ecfca Mon Sep 17 00:00:00 2001 From: Kevin Froman Date: Tue, 12 Feb 2019 22:37:08 -0600 Subject: [PATCH] fixed first log --- onionr/logger.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/onionr/logger.py b/onionr/logger.py index 896e2623..3c923276 100755 --- a/onionr/logger.py +++ b/onionr/logger.py @@ -134,8 +134,11 @@ def raw(data, fd = sys.stdout, sensitive = False): if get_settings() & OUTPUT_TO_CONSOLE: ts = fd.write('%s\n' % data) if get_settings() & OUTPUT_TO_FILE and not sensitive: - if os.path.getsize(_outputfile) >= MAX_LOG_SIZE: - return + try: + if os.path.getsize(_outputfile) >= MAX_LOG_SIZE: + return + except FileNotFoundError: + pass try: with open(_outputfile, "a+") as f: f.write(colors.filter(data) + '\n')