Skip to content

Commit

Permalink
fixed undefined case where discard value equals 0
Browse files Browse the repository at this point in the history
  • Loading branch information
jon committed Aug 10, 2022
1 parent acf33ad commit b555cf5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions phew/logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def truncate(target):
# calculate how many bytes we're aiming to discard
discard = size - target

if discard < 0:
if discard <= 0:
return

with open(_log_file, "rb") as infile:
Expand Down Expand Up @@ -70,4 +70,4 @@ def error(*items):
log("error", " ".join(map(str, items)))

def debug(*items):
log("debug", " ".join(map(str, items)))
log("debug", " ".join(map(str, items)))

0 comments on commit b555cf5

Please sign in to comment.