Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

void PTrace::Initialise ( unsigned  level,
const char *  filename = NULL,
unsigned  options = Timestamp | Thread | Blocks 
) [static]

Set the most common trace options. If filename is not NULL then a PTextFile is created and attached the trace output stream. This object is never closed or deleted until the termination of the program.

A trace output of the program name version and OS is written as well.

Definition at line 905 of file osutils.cxx.

References PTime::AsString(), PProcess::Current(), PTime::GetDayOfYear(), PProcess::GetManufacturer(), PProcess::GetName(), PProcess::GetOSClass(), PProcess::GetOSHardware(), PProcess::GetOSName(), PProcess::GetOSVersion(), PProcess::GetVersion(), PTime::GMT, GMTTime, PTime::Local, and RotateDaily.

Referenced by Serial::Main(), Md5::Main(), XMLRPCApp::Main(), Vxmltest::Main(), VidTest::Main(), ThreadSafe::Main(), Threadex::Main(), StunClient::Main(), IPV6Test::Main(), Emailtest::Main(), DtmfTest::Main(), Audio::Main(), and PProcess::PProcess().

{
  // If we have a tracing version, then open trace file and set modes
#if PTRACING
  PProcess & process = PProcess::Current();
#endif

#if PMEMORY_CHECK
  int ignoreAllocations = -1;
#endif

  PTrace_Filename = filename;
  PTraceOptions = options;

  if (options & RotateDaily)
    PTrace_lastDayOfYear = PTime((PTraceOptions&GMTTime) ? PTime::GMT : PTime::Local).GetDayOfYear();
  else
    PTrace_lastDayOfYear = 0;

  if (filename != NULL) {
#if PMEMORY_CHECK
    ignoreAllocations = PMemoryHeap::SetIgnoreAllocations(TRUE) ? 1 : 0;
#endif
    OpenTraceFile();
  }

  PTraceLevelThreshold = level;

  PTRACE(1, process.GetName()
         << "\tVersion " << process.GetVersion(TRUE)
         << " by " << process.GetManufacturer()
         << " on " << process.GetOSClass() << ' ' << process.GetOSName()
         << " (" << process.GetOSVersion() << '-' << process.GetOSHardware()
         << ") at " << PTime().AsString("yyyy/M/d h:mm:ss.uuu"));

#if PMEMORY_CHECK
  if (ignoreAllocations >= 0)
    PMemoryHeap::SetIgnoreAllocations(ignoreAllocations != 0);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index