Planeshift
log.h File Reference
#include "util/singleton.h"
#include "ivaria/reporter.h"
#include <iutil/vfs.h>

Go to the source code of this file.

Classes

class  LogCSV
 

Namespaces

 pslog
 

Macros

#define Bug1(a)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a); }
 
#define Bug2(a, b)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b); }
 
#define Bug3(a, b, c)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c); }
 
#define Bug4(a, b, c, d)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c, d); }
 
#define Bug5(a, b, c, d, e)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c, d, e); }
 
#define Bug6(a, b, c, d, e, f)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c, d, e, f); }
 
#define Debug(type, filter_id, ...)
 
#define Debug1(type, filter_id, a)
 
#define Debug2(type, filter_id, a, b)
 
#define Debug3(type, filter_id, a, b, c)
 
#define Debug4(type, filter_id, a, b, c, d)
 
#define Debug5(type, filter_id, a, b, c, d, e)
 
#define Debug6(type, filter_id, a, b, c, d, e, f)
 
#define Debug7(type, filter_id, a, b, c, d, e, f, g)
 
#define Debug8(type, filter_id, a, b, c, d, e, f, g, h)
 
#define DoLogBug(type)   pslog::DoLog( CS_REPORTER_SEVERITY_BUG, type, 0)
 
#define DoLogDebug(type)   pslog::DoLog( CS_REPORTER_SEVERITY_DEBUG, type, 0)
 
#define DoLogDebug2(type, filter_id)   pslog::DoLog( CS_REPORTER_SEVERITY_DEBUG, type, filter_id)
 
#define DoLogError(type)   pslog::DoLog( CS_REPORTER_SEVERITY_ERROR, type, 0)
 
#define DoLogNotify(type)   pslog::DoLog( CS_REPORTER_SEVERITY_NOTIFY, type, 0)
 
#define DoLogWarning(type)   pslog::DoLog( CS_REPORTER_SEVERITY_WARNING, type, 0)
 
#define Error1(a)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a); }
 
#define Error2(a, b)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b); }
 
#define Error3(a, b, c)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c); }
 
#define Error4(a, b, c, d)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c, d); }
 
#define Error5(a, b, c, d, e)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c, d, e); }
 
#define Error6(a, b, c, d, e, f)   { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c, d, e, f); }
 
#define Notify1(type, a)
 
#define Notify2(type, a, b)
 
#define Notify3(type, a, b, c)
 
#define Notify4(type, a, b, c, d)
 
#define Notify5(type, a, b, c, d, e)
 
#define Notify6(type, a, b, c, d, e, f)
 
#define Notify7(type, a, b, c, d, e, f, g)
 
#define Notify8(type, a, b, c, d, e, f, g, h)
 
#define Notify9(type, a, b, c, d, e, f, g, h, i)
 
#define Warning1(type, a)
 
#define Warning2(type, a, b)
 
#define Warning3(type, a, b, c)
 
#define Warning4(type, a, b, c, d)
 
#define Warning5(type, a, b, c, d, e)
 
#define Warning6(type, a, b, c, d, e, f)
 

Enumerations

enum  {
  CSV_AUTHENT, CSV_EXCHANGES, CSV_PALADIN, CSV_STATUS,
  CSV_ADVICE, CSV_ECONOMY, CSV_STUCK, CSV_SQL,
  MAX_CSV
}
 
enum  LOG_TYPES {
  LOG_ANY, LOG_WEATHER, LOG_SPAWN, LOG_CELPERSIST,
  LOG_PAWS, LOG_GROUP, LOG_CHEAT, LOG_LINMOVE,
  LOG_SPELLS, LOG_NEWCHAR, LOG_SUPERCLIENT, LOG_EXCHANGES,
  LOG_ADMIN, LOG_STARTUP, LOG_CHARACTER, LOG_CONNECTIONS,
  LOG_CHAT, LOG_NET, LOG_LOAD, LOG_NPC,
  LOG_TRADE, LOG_SOUND, LOG_COMBAT, LOG_SKILLXP,
  LOG_QUESTS, LOG_SCRIPT, LOG_RELATIONSHIPS, LOG_MESSAGES,
  LOG_CACHE, LOG_PETS, LOG_USER, LOG_LOOT,
  LOG_MINIGAMES, LOG_DRDATA, LOG_ACTIONLOCATION, LOG_ITEM,
  LOG_HIRE, MAX_FLAGS
}
 

Functions

void pslog::DisplayFlags (const char *name=NULL)
 
bool pslog::DoLog (int severity, LOG_TYPES type, uint32 filter_id)
 
const char * pslog::GetName (int id)
 
const char * pslog::GetSettingName (int id)
 
bool pslog::GetValue (const char *name)
 
void void pslog::Initialize (iObjectRegistry *object_reg)
 
void pslog::LogMessage (const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
 
void pslog::SetFlag (const char *name, bool flag, uint32 filter)
 

Variables

bool pslog::disp_flag [MAX_FLAGS]
 
iObjectRegistry * pslog::logger
 

Macro Definition Documentation

#define Bug1 (   a)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a); }

Definition at line 287 of file log.h.

#define Bug2 (   a,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b); }

Definition at line 289 of file log.h.

#define Bug3 (   a,
  b,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c); }

Definition at line 291 of file log.h.

#define Bug4 (   a,
  b,
  c,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c, d); }

Definition at line 293 of file log.h.

#define Bug5 (   a,
  b,
  c,
  d,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c, d, e); }

Definition at line 295 of file log.h.

#define Bug6 (   a,
  b,
  c,
  d,
  e,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_BUG, LOG_ANY, 0, a, b, c, d, e, f); }

Definition at line 297 of file log.h.

#define Debug (   type,
  filter_id,
  ... 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, __VA_ARGS__ ); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 199 of file log.h.

#define Debug1 (   type,
  filter_id,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 202 of file log.h.

#define Debug2 (   type,
  filter_id,
  a,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 205 of file log.h.

#define Debug3 (   type,
  filter_id,
  a,
  b,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b, c); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 208 of file log.h.

#define Debug4 (   type,
  filter_id,
  a,
  b,
  c,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b, c, d); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 211 of file log.h.

#define Debug5 (   type,
  filter_id,
  a,
  b,
  c,
  d,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b, c, d, e); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 214 of file log.h.

#define Debug6 (   type,
  filter_id,
  a,
  b,
  c,
  d,
  e,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b, c, d, e, f); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 217 of file log.h.

#define Debug7 (   type,
  filter_id,
  a,
  b,
  c,
  d,
  e,
  f,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b, c, d, e, f, g); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 220 of file log.h.

#define Debug8 (   type,
  filter_id,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
{ if (DoLogDebug2(type,filter_id)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_DEBUG, type, filter_id, a, b, c, d, e, f, g, h); }}
#define DoLogDebug2(type, filter_id)
Definition: log.h:191
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 223 of file log.h.

#define DoLogBug (   type)    pslog::DoLog( CS_REPORTER_SEVERITY_BUG, type, 0)

Definition at line 195 of file log.h.

#define DoLogDebug (   type)    pslog::DoLog( CS_REPORTER_SEVERITY_DEBUG, type, 0)

Definition at line 190 of file log.h.

#define DoLogDebug2 (   type,
  filter_id 
)    pslog::DoLog( CS_REPORTER_SEVERITY_DEBUG, type, filter_id)

Definition at line 191 of file log.h.

#define DoLogError (   type)    pslog::DoLog( CS_REPORTER_SEVERITY_ERROR, type, 0)

Definition at line 193 of file log.h.

#define DoLogNotify (   type)    pslog::DoLog( CS_REPORTER_SEVERITY_NOTIFY, type, 0)

Definition at line 192 of file log.h.

#define DoLogWarning (   type)    pslog::DoLog( CS_REPORTER_SEVERITY_WARNING, type, 0)

Definition at line 194 of file log.h.

#define Error1 (   a)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a); }

Definition at line 274 of file log.h.

#define Error2 (   a,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b); }

Definition at line 276 of file log.h.

#define Error3 (   a,
  b,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c); }

Definition at line 278 of file log.h.

#define Error4 (   a,
  b,
  c,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c, d); }

Definition at line 280 of file log.h.

#define Error5 (   a,
  b,
  c,
  d,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c, d, e); }

Definition at line 282 of file log.h.

#define Error6 (   a,
  b,
  c,
  d,
  e,
 
)    { pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_ERROR, LOG_ANY, 0, a, b, c, d, e, f); }

Definition at line 284 of file log.h.

#define Notify1 (   type,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 227 of file log.h.

#define Notify2 (   type,
  a,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 230 of file log.h.

#define Notify3 (   type,
  a,
  b,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 233 of file log.h.

#define Notify4 (   type,
  a,
  b,
  c,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c, d); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 236 of file log.h.

#define Notify5 (   type,
  a,
  b,
  c,
  d,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c, d, e); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 239 of file log.h.

#define Notify6 (   type,
  a,
  b,
  c,
  d,
  e,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c, d, e, f); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 242 of file log.h.

#define Notify7 (   type,
  a,
  b,
  c,
  d,
  e,
  f,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c, d, e, f, g); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 245 of file log.h.

#define Notify8 (   type,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c, d, e, f, g, h, i); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 248 of file log.h.

#define Notify9 (   type,
  a,
  b,
  c,
  d,
  e,
  f,
  g,
  h,
 
)
Value:
{ if (DoLogNotify(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_NOTIFY, type, 0, a, b, c, d, e, f, g, h, i); }}
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7
#define DoLogNotify(type)
Definition: log.h:192

Definition at line 251 of file log.h.

#define Warning1 (   type,
 
)
Value:
{ if (DoLogWarning(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_WARNING, type, 0, a); }}
#define DoLogWarning(type)
Definition: log.h:194
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 255 of file log.h.

#define Warning2 (   type,
  a,
 
)
Value:
{ if (DoLogWarning(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_WARNING, type, 0, a, b); }}
#define DoLogWarning(type)
Definition: log.h:194
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 258 of file log.h.

#define Warning3 (   type,
  a,
  b,
 
)
Value:
{ if (DoLogWarning(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_WARNING, type, 0, a, b, c); }}
#define DoLogWarning(type)
Definition: log.h:194
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 261 of file log.h.

#define Warning4 (   type,
  a,
  b,
  c,
 
)
Value:
{ if (DoLogWarning(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_WARNING, type, 0, a, b, c, d); }}
#define DoLogWarning(type)
Definition: log.h:194
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 264 of file log.h.

#define Warning5 (   type,
  a,
  b,
  c,
  d,
 
)
Value:
{ if (DoLogWarning(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_WARNING, type, 0, a, b, c, d, e); }}
#define DoLogWarning(type)
Definition: log.h:194
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 267 of file log.h.

#define Warning6 (   type,
  a,
  b,
  c,
  d,
  e,
 
)
Value:
{ if (DoLogWarning(type)){ \
pslog::LogMessage (__FILE__, __LINE__, __FUNCTION__, CS_REPORTER_SEVERITY_WARNING, type, 0, a, b, c, d, e, f); }}
#define DoLogWarning(type)
Definition: log.h:194
void LogMessage(const char *file, int line, const char *function, int severity, LOG_TYPES type, uint32 filter_id, const char *msg,...) CS_GNUC_PRINTF(7

Definition at line 270 of file log.h.