Cloudlog: cleanup zmq cloudlog warnings (#28896)

* Laikad: cleanup zmq cloudlog warnings

* Handle in cloudlog

* whitespace

* whitespace

* suppress before reconnecting in thread
old-commit-hash: 8f3037c956343453957571b61cfd1c3063cbbbab
This commit is contained in:
Harald Schäfer
2023-07-17 23:06:13 -07:00
committed by GitHub
parent f505f3be3a
commit fa823fadd2
+3
View File
@@ -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')