Skip to content

Commit 1c69535

Browse files
authored
Merge pull request #87 from yoichi/overflow-handler-example
avoid invalid use of buffer_overflow_handler in the example
2 parents 0058274 + 15aacb6 commit 1c69535

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -167,12 +167,12 @@ You can inject your own custom proc to handle buffer overflow in the event of co
167167
import msgpack
168168
from io import BytesIO
169169
170-
def handler(pendings):
170+
def overflow_handler(pendings):
171171
unpacker = msgpack.Unpacker(BytesIO(pendings))
172172
for unpacked in unpacker:
173173
print(unpacked)
174174
175-
logger = sender.FluentSender('app', host='host', port=24224, buffer_overflow_handler=handler)
175+
logger = sender.FluentSender('app', host='host', port=24224, buffer_overflow_handler=overflow_handler)
176176
177177
You should handle any exception in handler. fluent-logger ignores exceptions from ``buffer_overflow_handler``.
178178

@@ -198,7 +198,7 @@ module.
198198
199199
logging.basicConfig(level=logging.INFO)
200200
l = logging.getLogger('fluent.test')
201-
h = handler.FluentHandler('app.follow', host='host', port=24224, buffer_overflow_handler=handler)
201+
h = handler.FluentHandler('app.follow', host='host', port=24224, buffer_overflow_handler=overflow_handler)
202202
formatter = handler.FluentRecordFormatter(custom_format)
203203
h.setFormatter(formatter)
204204
l.addHandler(h)
@@ -228,7 +228,7 @@ You can inject your own custom proc to handle buffer overflow in the event of co
228228
import msgpack
229229
from io import BytesIO
230230
231-
def handler(pendings):
231+
def overflow_handler(pendings):
232232
unpacker = msgpack.Unpacker(BytesIO(pendings))
233233
for unpacked in unpacker:
234234
print(unpacked)
@@ -264,7 +264,7 @@ A sample configuration ``logging.yaml`` would be:
264264
host: localhost
265265
port: 24224
266266
tag: test.logging
267-
buffer_overflow_handler: handler
267+
buffer_overflow_handler: overflow_handler
268268
formatter: fluent_fmt
269269
level: DEBUG
270270
none:

0 commit comments

Comments
 (0)