8000 Document new options. · christer/fluent-logger-python@8dee055 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8dee055

Browse files
committed
Document new options.
1 parent 2f001c0 commit 8dee055

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

README.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,19 @@ fluentd, with tag 'app.follow' and the attributes 'from' and 'to'.
9090
cur_time = int(time.time())
9191
logger.emit_with_time('follow', cur_time, {'from': 'userA', 'to':'userB'})
9292
93+
To sending events with nanosecond-precision timestamps (Fluent 0.14 and up),
94+
specify `nanosecond_precision` on `FluentSender` or use `sender.EventTime`.
95+
96+
.. code:: python
97+
98+
# Use current time
99+
logger = sender.FluentSender('app', nanosecond_precision=True)
100+
logger.emit('follow', {'from': 'userA', 'to': 'userB'})
101+
102+
# Specify optional time
103+
cur_time = sender.EventTime(time.time())
104+
logger.emit_with_time('follow', cur_time, {'from': 'userA', 'to':'userB'})
105+
93106
You can detect an error via return value of `emit`. If an error happens in `emit`, `emit` returns `False` and get an error object using `last_error` method.
94107

95108
.. code:: python

0 commit comments

Comments
 (0)
0