mirror of
https://github.com/nicolargo/glances.git
synced 2024-12-28 11:41:46 +03:00
Extension of log file is not good when a previous one exist
This commit is contained in:
parent
f5d157a7cf
commit
cfbb1e3fc3
@ -88,7 +88,7 @@ def tempfile_name():
|
|||||||
ret = os.path.join(tempfile.gettempdir(), 'glances.log')
|
ret = os.path.join(tempfile.gettempdir(), 'glances.log')
|
||||||
if os.access(ret, os.F_OK) and not os.access(ret, os.W_OK):
|
if os.access(ret, os.F_OK) and not os.access(ret, os.W_OK):
|
||||||
print("WARNING: Couldn't write to log file {0} (Permission denied)".format(ret))
|
print("WARNING: Couldn't write to log file {0} (Permission denied)".format(ret))
|
||||||
ret = tempfile.mkstemp(prefix='glances', suffix='.tmp', text=True)
|
ret = tempfile.mkstemp(prefix='glances', suffix='.log', text=True)
|
||||||
print("Create a new log file: {0}".format(ret[1]))
|
print("Create a new log file: {0}".format(ret[1]))
|
||||||
return ret[1]
|
return ret[1]
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user