Use boolean toggle variable instead of comment

pull/25/head
Sogolumbo 2020-10-05 04:43:17 +02:00
parent 2c23bc0604
commit 39cfed8e6a
1 changed files with 6 additions and 3 deletions

View File

@ -111,7 +111,10 @@ class SpotifyAPI:
self.access_token = access_token
def log(str):
#print('[{}] {}'.format(time.strftime('%I:%M:%S'), str).encode(sys.stdout.encoding, errors='replace'))
fileOutput = False #replace with the opposite value if errors occur
if not fileOutput:
print('[{}] {}'.format(time.strftime('%I:%M:%S'), str).encode(sys.stdout.encoding, errors='replace'))
else:
sys.stdout.buffer.write('[{}] {}\n'.format(time.strftime('%I:%M:%S'), str).encode(sys.stdout.encoding, errors='replace'))
sys.stdout.flush()