StreamLinkforC  7.0.3-308369
Logging functionality

Typedefs

typedef void(* sl_log_cb) (void *ctx, sl_loglevel level, const char *message)
 Defines the log callback that you should implement to capture logging. More...
 

Enumerations

Functions

const char * sl_get_name (streamlink *client)
 Get the name of the StreamLink instance. More...
 
const char * sl_get_logstring (sl_loglevel level)
 Return a textual description for the given log level. More...
 
const char * sl_get_servicestatusstring (sl_servicestatus status)
 Get the string representing the connection service status. More...
 
const char * sl_get_sourcestatusstring (sl_sourcestatus status)
 Get the string representing the connection source status. More...
 
const char * sl_get_subjecttypestring (sl_subjecttype type)
 Get the string representing the rttp object type. More...
 
const char * sl_get_subjecterrorstring (sl_subjecterror error)
 Get the string representing the subject error code. More...
 
const char * sl_get_errorreasonstring (sl_error_reason reason)
 Get the string representing the subject error reason. More...
 
const char * sl_get_subjectstatusstring (sl_subjectstatus status)
 Get the string representing the subject error code. More...
 
void sl_log (streamlink *client, sl_loglevel level, const char *fmt,...)
 Log a message to the StreamLink logger. More...
 
void sl_set_log_callback (streamlink *client, sl_log_cb callback, void *ctx)
 Set the log callback function. More...
 

Detailed Description

Typedef Documentation

typedef void(* sl_log_cb) (void *ctx, sl_loglevel level, const char *message)

Defines the log callback that you should implement to capture logging.

Parameters
ctx- The context the callback was registered with
level- The level that the message should be logged at
message- The message that should be logged

Your logger callback should be registered with sl_set_log_callback()

Enumeration Type Documentation

Enumeration that represents the available logging levels.

Enumerator
sl_LOG_FINEST 

Used for the most finely detailed tracing messages

sl_LOG_FINER 

Used for fairly detailed tracing messages.

sl_LOG_DEBUG 

Used for tracing messages

sl_LOG_INFO 

Used for information messages

sl_LOG_NOTIFY 

Used for messages of more importance than sl_loglevel::LOG_INFO but may not indicate problems.

sl_LOG_WARN 

Used for messages which indicate a potential problem.

sl_LOG_ERROR 

Used for messages which indicate a problem.

sl_LOG_CRITICAL 

Used for messages indicating a serious failure.

sl_LOG_CONFIG 

Used for messages that indicate a problem or feedback with library configuration.

Function Documentation

const char* sl_get_errorreasonstring ( sl_error_reason  reason)

Get the string representing the subject error reason.

Parameters
error- The subject error reason
Return values
-A string reperesenting the subject error reason
const char* sl_get_logstring ( sl_loglevel  level)

Return a textual description for the given log level.

Parameters
level- Log level
Returns
A textual description
Note
The memory returned by this function should not be passed free()
const char* sl_get_name ( streamlink client)

Get the name of the StreamLink instance.

Returns
The name of the StreamLink instance

This function can be useful for logging purposes

const char* sl_get_servicestatusstring ( sl_servicestatus  status)

Get the string representing the connection service status.

Parameters
status- Status
Return values
-A string reperesenting the connection service status
const char* sl_get_sourcestatusstring ( sl_sourcestatus  status)

Get the string representing the connection source status.

Parameters
status- Status
Return values
-A string reperesenting the connection source status
const char* sl_get_subjecterrorstring ( sl_subjecterror  error)

Get the string representing the subject error code.

Parameters
error- The subject error code
Return values
-A string reperesenting the subject error code
const char* sl_get_subjectstatusstring ( sl_subjectstatus  status)

Get the string representing the subject error code.

Parameters
status- The subject status code
Return values
-A string reperesenting the subject status code
const char* sl_get_subjecttypestring ( sl_subjecttype  type)

Get the string representing the rttp object type.

Parameters
type- The rttp object type value
Return values
-A string reperesenting the rttp object type
void sl_log ( streamlink client,
sl_loglevel  level,
const char *  fmt,
  ... 
)

Log a message to the StreamLink logger.

Parameters
client- The StreamLink client
level- Log level
fmt- printf() style format
void sl_set_log_callback ( streamlink client,
sl_log_cb  callback,
void *  ctx 
)

Set the log callback function.

Parameters
client- The StreamLink client
callback- Callback function
ctx- Callback context

The callback function will be invoked for each log message that should be logged.


Generated on Tue Oct 16 2018 12:25:43 for StreamLinkforC