mirror of
https://github.com/FAUSheppy/config
synced 2025-12-06 07:01:36 +01:00
outsourced hl errorhandling
This commit is contained in:
@@ -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
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