outsourced hl errorhandling

This commit is contained in:
Sheppy
2017-02-24 15:48:52 +01:00
parent f017875ab6
commit ff74c8b72d
2 changed files with 9 additions and 5 deletions

View File

@@ -6,11 +6,7 @@ import sys
import os
import shlex
import psutil
def error(s):
with open("herbstlog",'a') as f:
time = str(datetime.datetime.now().time())[:-7] #cut seconds at the end
f.write(time + "ERROR" + os.path.basename(__file__) + s)
from hl_error import error
out = subprocess.check_output(['xdpyinfo']).decode().split('\n')

8
herbstluftwm/hl_error.py Executable file
View File

@@ -0,0 +1,8 @@
import datetime
import sys
import os
def error(s):
with open("herbstlog",'a') as f:
time = str(datetime.datetime.now().time())[:-7] #cut seconds at the end
f.write(time + "ERROR" + os.path.basename(__file__) + s)