Cloudlog: cleanup zmq cloudlog warnings (#28896)

* Laikad: cleanup zmq cloudlog warnings

* Handle in cloudlog

* whitespace

* whitespace

* suppress before reconnecting in thread
pull/28951/head
Harald Schäfer 2 years ago committed by GitHub
parent fccd334dc9
commit 8f3037c956
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      system/swaglog.py

@ -1,6 +1,7 @@
import logging
import os
import time
import warnings
from pathlib import Path
from logging.handlers import BaseRotatingHandler
@ -90,6 +91,8 @@ class UnixDomainSocketHandler(logging.Handler):
def emit(self, record):
if os.getpid() != self.pid:
# TODO suppresses warning about forking proc with zmq socket, fix root cause
warnings.filterwarnings("ignore", category=ResourceWarning, message="unclosed.*<zmq.*>")
self.connect()
msg = self.format(record).rstrip('\n')

Loading…
Cancel
Save