mirror of
https://github.com/certbot/certbot.git
synced 2026-06-04 14:26:10 -04:00
add logging function
This commit is contained in:
parent
99a679209c
commit
ef8d3b661e
1 changed files with 6 additions and 3 deletions
|
|
@ -2,9 +2,6 @@
|
|||
|
||||
# functions common to the various kinds of daemon
|
||||
|
||||
# TODO: define a log function that sends a pubsub message to the
|
||||
# logger daemon
|
||||
|
||||
import time, binascii
|
||||
from Crypto import Random
|
||||
|
||||
|
|
@ -27,3 +24,9 @@ def random():
|
|||
def random_raw():
|
||||
"""Return 32 random bytes."""
|
||||
return Random.get_random_bytes(32)
|
||||
|
||||
def log(msg, session = None):
|
||||
if session:
|
||||
r.publish("logs", "%s: %s" % (short(session), msg))
|
||||
else:
|
||||
r.publish("logs", "%s" % session)
|
||||
|
|
|
|||
Loading…
Reference in a new issue