Skip to content

Commit

Permalink
ability to set logging truncation thresholds
Browse files Browse the repository at this point in the history
  • Loading branch information
lowfatcode committed Sep 2, 2022
1 parent 418fb60 commit 367cfcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions phew/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def file_size(file):
except OSError:
return None

def set_truncate_thresholds(truncate_at, truncate_to):
_log_truncate_at = truncate_at
_log_truncate_to = truncate_to

# truncates the log file down to a target size while maintaining
# clean line breaks
def truncate(file, target_size):
Expand Down

0 comments on commit 367cfcc

Please sign in to comment.