Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vsnet_debug.cpp File Reference
#include "vsnet_debug.h"
#include <time.h>
#include <cstring>
#include <sys/time.h>

Go to the source code of this file.

Classes

struct  TimeTriggerStruct
 

Functions

ostream & operator<< (ostream &ostr, const TimeTriggerStruct &c)
 
ostream & vsnetDbgOut (const char *file, int line)
 

Variables

static TimeTriggerStruct time_trigger
 

Function Documentation

ostream& operator<< ( ostream &  ostr,
const TimeTriggerStruct c 
)

Definition at line 17 of file vsnet_debug.cpp.

18 {
19 #ifndef _WIN32
20  struct timeval tv;
21  gettimeofday( &tv, NULL );
22  ostr<<tv.tv_sec<<":"<<tv.tv_usec;
23 #endif
24  return ostr;
25 }
ostream& vsnetDbgOut ( const char *  file,
int  line 
)

Definition at line 27 of file vsnet_debug.cpp.

References accountXML::file, and PTHREAD_SELF_OR_NONE.

28 {
29  const char *printme = file;
30  int len = strlen( file );
31  if (len > 30) printme = &file[len-30];
32 #ifdef VSNET_DEBUG
33  clog<<PTHREAD_SELF_OR_NONE<<" "
34  <<time_trigger
35  <<" "<<printme<<":"<<line<<" ";
36 #else /* !VSNET_DEBUG */
37  clog<<printme<<":"<<line<<" ";
38 #endif /* VSNET_DEBUG */
39  return clog;
40 }

Variable Documentation

TimeTriggerStruct time_trigger
static

Definition at line 16 of file vsnet_debug.cpp.