Open Broadcaster Software
Free, open source software for live streaming and recording
base.h File Reference

Go to the source code of this file.

Macros

#define STRINGIFY(x)   #x
 
#define STRINGIFY_(x)   STRINGIFY(x)
 
#define S__LINE__   STRINGIFY_(__LINE__)
 
#define INT_CUR_LINE   __LINE__
 
#define FILE_LINE   __FILE__ " (" S__LINE__ "): "
 
#define PRINTFATTR(f, a)   __attribute__((__format__(__printf__, f, a)))
 

Typedefs

typedef void(* log_handler_t) (int lvl, const char *msg, va_list args, void *p)
 

Enumerations

enum  { LOG_ERROR = 100, LOG_WARNING = 200, LOG_INFO = 300, LOG_DEBUG = 400 }
 

Functions

EXPORT void base_get_log_handler (log_handler_t *handler, void **param)
 
EXPORT void base_set_log_handler (log_handler_t handler, void *param)
 
EXPORT void base_set_crash_handler (void(*handler)(const char *, va_list, void *), void *param)
 
EXPORT void blogva (int log_level, const char *format, va_list args)
 
EXPORT void blog (int log_level, const char *format,...)
 
EXPORT void bcrash (const char *format,...)
 

Macro Definition Documentation

#define FILE_LINE   __FILE__ " (" S__LINE__ "): "
#define INT_CUR_LINE   __LINE__
#define PRINTFATTR (   f,
 
)    __attribute__((__format__(__printf__, f, a)))
#define S__LINE__   STRINGIFY_(__LINE__)
#define STRINGIFY (   x)    #x
#define STRINGIFY_ (   x)    STRINGIFY(x)

Typedef Documentation

typedef void(* log_handler_t) (int lvl, const char *msg, va_list args, void *p)

Enumeration Type Documentation

anonymous enum
Enumerator
LOG_ERROR 

Use if there's a problem that can potentially affect the program, but isn't enough to require termination of the program.

Use in creation functions and core subsystem functions. Places that should definitely not fail.

LOG_WARNING 

Use if a problem occurs that doesn't affect the program and is recoverable.

Use in places where where failure isn't entirely unexpected, and can be handled safely.

LOG_INFO 

Informative essage to be displayed in the log.

LOG_DEBUG 

Debug message to be used mostly by developers.

Function Documentation

EXPORT void base_get_log_handler ( log_handler_t handler,
void **  param 
)
EXPORT void base_set_crash_handler ( void(*)(const char *, va_list, void *)  handler,
void *  param 
)
EXPORT void base_set_log_handler ( log_handler_t  handler,
void *  param 
)
EXPORT void bcrash ( const char *  format,
  ... 
)
EXPORT void blog ( int  log_level,
const char *  format,
  ... 
)
EXPORT void blogva ( int  log_level,
const char *  format,
va_list  args 
)