Skip to content

Commit

Permalink
Merge branch 'Delgan:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
tim-x-y-z authored Aug 2, 2024
2 parents d5d4282 + 85379fd commit c9995ac
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/resources/recipes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -323,11 +323,13 @@ Another possibility is to use a third party library like |zmq|_ for example.
# client.py
import zmq
from zmq.log.handlers import PUBHandler
from logging import Formatter
from loguru import logger
socket = zmq.Context().socket(zmq.PUB)
socket.connect("tcp://127.0.0.1:12345")
handler = PUBHandler(socket)
handler.setFormatter(Formatter("%(message)s"))
logger.add(handler)
logger.info("Logging from client")
Expand Down

0 comments on commit c9995ac

Please sign in to comment.