mirror of
https://github.com/FAUSheppy/config
synced 2025-12-06 15:11:35 +01:00
outsourced hl errorhandling
This commit is contained in:
@@ -6,11 +6,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import shlex
|
import shlex
|
||||||
import psutil
|
import psutil
|
||||||
|
from hl_error import error
|
||||||
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)
|
|
||||||
|
|
||||||
out = subprocess.check_output(['xdpyinfo']).decode().split('\n')
|
out = subprocess.check_output(['xdpyinfo']).decode().split('\n')
|
||||||
|
|
||||||
|
|||||||
8
herbstluftwm/hl_error.py
Executable file
8
herbstluftwm/hl_error.py
Executable 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)
|
||||||
Reference in New Issue
Block a user