Skip to content

Commit

Permalink
Merge pull request #396 from vlameiras/ensures-logs-dir
Browse files Browse the repository at this point in the history
Creates logs dir if it does not exist
  • Loading branch information
CryptoGnome authored Dec 11, 2021
2 parents 32f2b2a + 6726be1 commit f5c5def
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions LimitSwap.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,14 @@ def load_tokens_file(tokens_path, load_message = True):
"""""""""""""""""""""""""""
//ERROR LOGGING
"""""""""""""""""""""""""""
os.makedirs('./logs', exist_ok=True)

if not os.path.exists('./logs/errors.log'):
open('./logs/errors.log', 'w').close()

if not os.path.exists('./logs/exceptions.log'):
open('./logs/exceptions.log', 'w').close()

log_format = '%(levelname)s: %(asctime)s %(message)s'
logging.basicConfig(filename='./logs/errors.log',
level=logging.INFO,
Expand Down

0 comments on commit f5c5def

Please sign in to comment.