Overview
| Comment: | remove leftover fix conversion from multibyte |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | master | trunk |
| Files: | files | file ages | folders |
| SHA3-256: |
dbc07278696fdfd3a22c0e19e1e71e83 |
| User & Date: | arcade@b1t.name on 2012-07-10 14:02:54.000 |
| Other Links: | branch diff | manifest | tags |
Context
|
2012-12-10
| ||
| 13:04 | extra space, support for IPv6 check-in: 5d265df0fc user: arcade@b1t.name tags: master, trunk | |
|
2012-07-10
| ||
| 14:02 | remove leftover fix conversion from multibyte check-in: dbc0727869 user: arcade@b1t.name tags: master, trunk | |
|
2012-07-09
| ||
| 14:25 | switched sg_import to python3.2 reworked SysLogHandlerQueue to stick to one socket reworked FReadlineQueue to use io.FileIO for file operation check-in: 67e8b3309d user: arcade@b1t.name tags: master, trunk | |
Changes
Modified squid-tagger.py
from [568859367f]
to [29eb01c1f2].
| ︙ | ︙ | |||
104 105 106 107 108 109 110 | def __init__(self): logging.handlers.SysLogHandler.__init__(self, '/dev/log') self._tail = gevent.queue.Queue() self._worker = None def emit(self, record): # my syslog is broken and cannot into UTF-8 BOM | | < < | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 |
def __init__(self):
logging.handlers.SysLogHandler.__init__(self, '/dev/log')
self._tail = gevent.queue.Queue()
self._worker = None
def emit(self, record):
# my syslog is broken and cannot into UTF-8 BOM
record.msg = record.msg.encode('utf-8')
self._tail.put(record)
if self._worker == None:
# in case queue is empty we will spawn new worker
# all workers are logged so we can kill them on close()
self._worker = gevent.spawn(self._writer)
def _writer(self):
# here we are locking the queue so we can be sure we are the only one
while not self._tail.empty():
logging.handlers.SysLogHandler.emit(self, self._tail.get())
self._worker = None
def close(self):
if self._worker != None:
gevent.kill(self._worker)
logging.handlers.SysLogHandler.close(self)
logger = logging.getLogger('squidTag')
|
| ︙ | ︙ |