Skip to content

Commit

Permalink
fixes #103
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Jul 15, 2020
1 parent c5d0c17 commit 4bf8c7e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Pyxis/Internals.py
Original file line number Diff line number Diff line change
Expand Up @@ -726,15 +726,15 @@ def set_logfile (filename,quiet=False):
sys.stdout,sys.stderr = sys.__stdout__,sys.__stderr__;
_current_logobj = None;
else:
mode = "wa";
mode = "a";
# append to file if name starts with +, or if file has already been used as a log this session, or if flush is off
if Pyxis.Context.get("LOG_FLUSH"):
mode = "w";
if filename[0] == '+':
filename = filename[1:];
mode = "wa";
mode = "a";
if filename in _visited_logfiles:
mode = "wa";
mode = "a";
Pyxis.ModSupport.makedir(os.path.dirname(filename),no_interpolate=True);
_current_logobj = sys.stdout = sys.stderr = open(filename,mode);
hdr = Pyxis.Context.get("LOG_HEADER");
Expand Down

0 comments on commit 4bf8c7e

Please sign in to comment.