QuickIO  0.2
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Macros
log.h File Reference

Provides some useful logging shortcuts. More...

#include "qev.h"

Go to the source code of this file.

Macros

#define DEBUG(format,...)
 Output debug info to the console, only when not built for prod.
 
#define INFO(format,...)
 General useful information. More...
 
#define WARN(format,...)
 Output warning. More...
 
#define PERROR(format,...)
 Like perror() More...
 
#define CRITICAL(format,...)
 Output critical, non-fatal error. More...
 
#define FATAL(format,...)
 A fatal error, after which nothing can continue. More...
 
#define ASSERT(cond, msg,...)
 If the condition is not true, it brings down the app with it, logging the given message as fatal. More...
 

Detailed Description

Provides some useful logging shortcuts.

Author
Andrew Stone andre.nosp@m.w@cl.nosp@m.ovar..nosp@m.com

Macro Definition Documentation

#define ASSERT (   cond,
  msg,
  ... 
)
Value:
if (!(cond)) { \
FATAL(msg, ##__VA_ARGS__); }
#define FATAL(format,...)
A fatal error, after which nothing can continue.
Definition: log.h:60

If the condition is not true, it brings down the app with it, logging the given message as fatal.

#define CRITICAL (   format,
  ... 
)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
"%s:%d : " format, __FILE__, __LINE__, ##__VA_ARGS__)
#define G_LOG_DOMAIN
We log to quickio.
Definition: quickio.h:18

Output critical, non-fatal error.

#define FATAL (   format,
  ... 
)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, \
"%s:%d : " format, __FILE__, __LINE__, ##__VA_ARGS__)
#define G_LOG_DOMAIN
We log to quickio.
Definition: quickio.h:18

A fatal error, after which nothing can continue.

#define INFO (   format,
  ... 
)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, \
"%s:%d : " format, __FILE__, __LINE__, ##__VA_ARGS__)
#define G_LOG_DOMAIN
We log to quickio.
Definition: quickio.h:18

General useful information.

#define PERROR (   format,
  ... 
)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_CRITICAL, \
"%s:%d : " format ": %s", __FILE__, __LINE__, ##__VA_ARGS__, \
strerror(errno))
#define G_LOG_DOMAIN
We log to quickio.
Definition: quickio.h:18

Like perror()

#define WARN (   format,
  ... 
)
Value:
g_log(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, \
"%s:%d : " format, __FILE__, __LINE__, ##__VA_ARGS__)
#define G_LOG_DOMAIN
We log to quickio.
Definition: quickio.h:18

Output warning.