Use boolean toggle variable instead of comment
parent
2c23bc0604
commit
39cfed8e6a
|
@ -111,9 +111,12 @@ class SpotifyAPI:
|
||||||
self.access_token = access_token
|
self.access_token = access_token
|
||||||
|
|
||||||
def log(str):
|
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
|
||||||
sys.stdout.buffer.write('[{}] {}\n'.format(time.strftime('%I:%M:%S'), str).encode(sys.stdout.encoding, errors='replace'))
|
if not fileOutput:
|
||||||
sys.stdout.flush()
|
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()
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Parse arguments.
|
# Parse arguments.
|
||||||
|
|
Loading…
Reference in New Issue