fix date fro today
This commit is contained in:
parent
f9e65e8dac
commit
8b9f19145f
@ -1,6 +1,6 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
from datetime import date
|
from datetime import datetime
|
||||||
from platform import uname
|
from platform import uname
|
||||||
from subprocess import PIPE, STDOUT, run
|
from subprocess import PIPE, STDOUT, run
|
||||||
from time import sleep
|
from time import sleep
|
||||||
@ -55,7 +55,7 @@ def read_log(type, _date):
|
|||||||
config = read_yaml()
|
config = read_yaml()
|
||||||
log_path = config['logging']['log_path']
|
log_path = config['logging']['log_path']
|
||||||
|
|
||||||
if _date == date.today():
|
if _date == datetime.now().strftime('%Y-%m-%d'):
|
||||||
log_file = os.path.join(log_path, '{}.log'.format(type))
|
log_file = os.path.join(log_path, '{}.log'.format(type))
|
||||||
else:
|
else:
|
||||||
log_file = os.path.join(log_path, '{}.log.{}'.format(type, _date))
|
log_file = os.path.join(log_path, '{}.log.{}'.format(type, _date))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user