Skip to content

Commit

Permalink
refactor the method 'file_sink' of the packages 'ml/utils'
Browse files Browse the repository at this point in the history
  • Loading branch information
Hanna Imshenetska authored and Hanna Imshenetska committed Oct 31, 2024
1 parent ad8400e commit 64ee071
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/syngen/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.9.49
0.9.50rc0
8 changes: 5 additions & 3 deletions src/syngen/ml/utils/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,11 @@ def file_sink(message):
"""
Save logs to the log file
"""
with open(os.getenv("SUCCESS_LOG_FILE"), "a") as log_file:
log_message = fetch_log_message(message)
log_file.write(log_message + "\n")
path_to_logs = os.getenv("SUCCESS_LOG_FILE")
if path_to_logs is not None:
with open(path_to_logs, "a") as log_file:
log_message = fetch_log_message(message)
log_file.write(log_message + "\n")


def console_sink(record):
Expand Down

0 comments on commit 64ee071

Please sign in to comment.