Skip to content

Commit

Permalink
better disabling of logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Henri DAVID committed Dec 15, 2023
1 parent b22100c commit 4774dd1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Log.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,20 @@

USER_HOME = os.path.expanduser('~')
LOG_DIRECTORY = USER_HOME+"/Documents/Ableton/User Library/Remote Scripts"
try:
os.makedirs(LOG_DIRECTORY, exist_ok=True)
except TypeError:
try:
os.makedirs(LOG_DIRECTORY)
except OSError:
pass
LOG_FILE = LOG_DIRECTORY + "/log.txt"

if Settings.LOGGING:
try:
os.makedirs(LOG_DIRECTORY, exist_ok=True)
except TypeError:
try:
os.makedirs(LOG_DIRECTORY)
except OSError:
pass

with open(LOG_FILE, 'a') as f:
f.write('====================\n')

log_num = 0

def log(message):
Expand Down

0 comments on commit 4774dd1

Please sign in to comment.