8000 add event.py · socrateslee/fluent-logger-python@81ebfaa · GitHub
[go: up one dir, main page]

Skip to content

Commit 81ebfaa

Browse files
committed
add event.py
1 parent dd80477 commit 81ebfaa

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

fluent/event.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from fluent import logger
2+
3+
class Event:
4+
def __init__(self, label, data, **kwargs):
5+
if not isinstance(data, dict) :
6+
raise Exception("data must be dict")
7+
l = kwargs.has_key("logger") and kwargs['logger'] or logger.get_global_logger()
8+
l.emit(label, data)

0 commit comments

Comments
 (0)
0