FluentLogger: fluent-logger-mbed A structured logger for Fluentd (mbed)

Dependents:   FluentLogger_Hello SNIC-FluentLogger-example

Embed: (wiki syntax)

« Back to documentation index

FluentLogger Class Reference

FluentLogger Class Reference

Fluent Logger for mbed. More...

#include <FluentLogger.h>

Public Member Functions

 FluentLogger (const char *host, const int port=24224, uint32_t bufsize=128)
 Create a FluentLogger instance.
int open ()
 Open connection (automatically called on log)
int close ()
 Close connection (if you want)
int log (const char *tag, const char *msg)
 Send simple string message to fluent server with tag.
int log (const char *tag, uMP &msg)
 Send MassagePacked message to fluent server with tag.

Detailed Description

Fluent Logger for mbed.

Definition at line 26 of file FluentLogger.h.


Constructor & Destructor Documentation

FluentLogger ( const char *  host,
const int  port = 24224,
uint32_t  bufsize = 128 
)

Create a FluentLogger instance.

Parameters:
hostfluentd server hostname/ipaddress
portfluentd server port (default: 24224)
bufsizemessage buffer length (default: 128)

Definition at line 22 of file FluentLogger.cpp.


Member Function Documentation

int close (  )

Close connection (if you want)

Return values:
0Success
-1Failure

Definition at line 44 of file FluentLogger.cpp.

int log ( const char *  tag,
uMP msg 
)

Send MassagePacked message to fluent server with tag.

Parameters:
tagtag
msgMessagePacked message
Return values:
0Success
-1Failure

Definition at line 85 of file FluentLogger.cpp.

int log ( const char *  tag,
const char *  msg 
)

Send simple string message to fluent server with tag.

Parameters:
tagtag
msgnull terminated string
Return values:
0Success
-1Failure

Definition at line 54 of file FluentLogger.cpp.

int open (  )

Open connection (automatically called on log)

Return values:
0Success
-1Failure

Definition at line 29 of file FluentLogger.cpp.