Fork me on GitHub
Data Structures | Macros | Typedefs | Functions
janus_jsonlog.c File Reference

Janus JSON logger plugin. More...

#include "logger.h"
#include "../debug.h"
#include "../config.h"
#include "../mutex.h"
#include "../utils.h"
Include dependency graph for janus_jsonlog.c:

Data Structures

struct  janus_jsonlog_line
 

Macros

#define JANUS_JSONLOG_VERSION   1
 
#define JANUS_JSONLOG_VERSION_STRING   "0.0.1"
 
#define JANUS_JSONLOG_DESCRIPTION   "This is a trivial sample logger plugin for Janus, which saves log lines to a local JSON file."
 
#define JANUS_JSONLOG_NAME   "JANUS JSON logger plugin"
 
#define JANUS_JSONLOG_AUTHOR   "Meetecho s.r.l."
 
#define JANUS_JSONLOG_PACKAGE   "janus.logger.jsonlog"
 
#define JANUS_JSONLOG_ERROR_INVALID_REQUEST   411
 
#define JANUS_JSONLOG_ERROR_MISSING_ELEMENT   412
 
#define JANUS_JSONLOG_ERROR_INVALID_ELEMENT   413
 
#define JANUS_JSONLOG_ERROR_UNKNOWN_ERROR   499
 

Typedefs

typedef struct janus_jsonlog_line janus_jsonlog_line
 

Functions

janus_loggercreate (void)
 
int janus_jsonlog_init (const char *server_name, const char *config_path)
 
void janus_jsonlog_destroy (void)
 
int janus_jsonlog_get_api_compatibility (void)
 
int janus_jsonlog_get_version (void)
 
const char * janus_jsonlog_get_version_string (void)
 
const char * janus_jsonlog_get_description (void)
 
const char * janus_jsonlog_get_name (void)
 
const char * janus_jsonlog_get_author (void)
 
const char * janus_jsonlog_get_package (void)
 
void janus_jsonlog_incoming_logline (int64_t timestamp, const char *line)
 
json_tjanus_jsonlog_handle_request (json_t *request)
 

Detailed Description

Janus JSON logger plugin.

Author
Lorenzo Miniero loren.nosp@m.zo@m.nosp@m.eetec.nosp@m.ho.c.nosp@m.om

This is a trivial logger plugin for Janus, which is only there to showcase how you can implement your own external logger for log lines coming from the Janus core or one of the plugins. This specific logger plugin serializes log lines to a JSON object and saves them all to a configured local file.

Loggers

Macro Definition Documentation

◆ JANUS_JSONLOG_AUTHOR

#define JANUS_JSONLOG_AUTHOR   "Meetecho s.r.l."

◆ JANUS_JSONLOG_DESCRIPTION

#define JANUS_JSONLOG_DESCRIPTION   "This is a trivial sample logger plugin for Janus, which saves log lines to a local JSON file."

◆ JANUS_JSONLOG_ERROR_INVALID_ELEMENT

#define JANUS_JSONLOG_ERROR_INVALID_ELEMENT   413

◆ JANUS_JSONLOG_ERROR_INVALID_REQUEST

#define JANUS_JSONLOG_ERROR_INVALID_REQUEST   411

◆ JANUS_JSONLOG_ERROR_MISSING_ELEMENT

#define JANUS_JSONLOG_ERROR_MISSING_ELEMENT   412

◆ JANUS_JSONLOG_ERROR_UNKNOWN_ERROR

#define JANUS_JSONLOG_ERROR_UNKNOWN_ERROR   499

◆ JANUS_JSONLOG_NAME

#define JANUS_JSONLOG_NAME   "JANUS JSON logger plugin"

◆ JANUS_JSONLOG_PACKAGE

#define JANUS_JSONLOG_PACKAGE   "janus.logger.jsonlog"

◆ JANUS_JSONLOG_VERSION

#define JANUS_JSONLOG_VERSION   1

◆ JANUS_JSONLOG_VERSION_STRING

#define JANUS_JSONLOG_VERSION_STRING   "0.0.1"

Typedef Documentation

◆ janus_jsonlog_line

Function Documentation

◆ create()

janus_logger* create ( void  )

◆ janus_jsonlog_destroy()

void janus_jsonlog_destroy ( void  )

◆ janus_jsonlog_get_api_compatibility()

int janus_jsonlog_get_api_compatibility ( void  )

◆ janus_jsonlog_get_author()

const char * janus_jsonlog_get_author ( void  )

◆ janus_jsonlog_get_description()

const char * janus_jsonlog_get_description ( void  )

◆ janus_jsonlog_get_name()

const char * janus_jsonlog_get_name ( void  )

◆ janus_jsonlog_get_package()

const char * janus_jsonlog_get_package ( void  )

◆ janus_jsonlog_get_version()

int janus_jsonlog_get_version ( void  )

◆ janus_jsonlog_get_version_string()

const char * janus_jsonlog_get_version_string ( void  )

◆ janus_jsonlog_handle_request()

json_t * janus_jsonlog_handle_request ( json_t request)

◆ janus_jsonlog_incoming_logline()

void janus_jsonlog_incoming_logline ( int64_t  timestamp,
const char *  line 
)

◆ janus_jsonlog_init()

int janus_jsonlog_init ( const char *  server_name,
const char *  config_path 
)