Skip to content

Commit

Permalink
logging improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
sulincix committed Jul 9, 2024
1 parent 0b5e783 commit ad75b57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/module/daemon.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def module_init():
debug("Creating fifo")
os.mkfifo("/{}/pardus-greeter".format(busdir))
try:
debug("Listening fifo")
with open("/{}/pardus-greeter".format(busdir),"r") as f:
username=""
password=""
Expand Down
4 changes: 3 additions & 1 deletion src/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ def get(variable, default=None, section="pardus"):
return False
return str(ret)

ltime=time.time()
if get("debug", False, "pardus"):
def debug(msg):
log("[DEBUG] => {}\n".format(msg), type="debug")
log("[DEBUG:{}] => {}\n".format((int(1000*(time.time()-ltime))), msg), type="debug")
ltime=time.time()
else:
def debug(msg):
return
Expand Down

0 comments on commit ad75b57

Please sign in to comment.