#include <NclLog.h>
Collaboration diagram for NclLog:

Definition at line 35 of file NclLog.h.
Public Member Functions | |
| NclLog (void) | |
| NclLog (wxString name) | |
| virtual | ~NclLog (void) |
| void | Clear () |
| bool | Line (wxString message) |
| bool | Line (wxString format, wxString message) |
| bool | Line (wxString format, long number) |
| bool | Line (wxString format, long number1, long number2) |
| void | Creation (wxString name, NclBase *base) |
| void | Destruction (wxString name, NclBase *base) |
Private Member Functions | |
| void | Open () |
| wxString | DateTime (wxString message) |
Private Attributes | |
| wxString | logFileName |
| FILE * | logFilePtr |
|
|
Use the default name for the log file. The default name is NClip.log if the current directory.
Definition at line 8 of file NclLog.cpp. References Open().
00009 {
00010 logFileName= "NClip.log";
00011 Open( );
00012 }
|
|
|
Provide the name of the log file.
Definition at line 14 of file NclLog.cpp. References Open().
00015 {
00016 logFileName = name;
00017 Open( );
00018 }
|
|
|
Close the log.
Definition at line 20 of file NclLog.cpp. References Line().
00021 {
00022 wxString m = "--------------------------------------------";
00023 m.Append( "Close the log file." );
00024 Line( m );
00025 fclose ( logFilePtr );
00026 }
|
|
|
Clear the log Definition at line 36 of file NclLog.cpp. References Line().
00037 {
00038 fclose ( logFilePtr );
00039 logFilePtr = fopen ( logFileName, "w" );
00040 wxString m = "The log file was cleared.";
00041 Line( m );
00042 }
|
|
||||||||||||
|
Log the creation of an object.
Definition at line 104 of file NclLog.cpp. References NclBase::GetSerialNumberString(), and Line(). Referenced by NclSession::Init(), NclCanvas::Init(), Mdo::Mdo(), NclBase::NclBase(), NclFileParser::NclFileParser(), NclFrame::NclFrame(), NclGridFromText::NclGridFromText(), NclSplitterWindow::NclSplitterWindow(), and NclTemplateClass::NclTemplateClass().
00105 {
00106 wxString m = "#";
00107 m.Append ( " " );
00108 m.Append( base->GetSerialNumberString());
00109 m.Append( " " );
00110 m.Append ( name );
00111 m.Append( " Created.");
00112 Line( m );
00113 }
|
|
|
Return the Date and Time as a wxString.
Definition at line 89 of file NclLog.cpp. Referenced by Line().
00090 {
00091 // Add the current date and time to the wxString.
00092 wxString m = "";
00093 time_t rawtime;
00094 struct tm * timeinfo;
00095 time ( &rawtime );
00096 timeinfo = localtime ( &rawtime );
00097 wxString dt = asctime( timeinfo );
00098 m.Append(dt.Left( (dt.Len()-1)));
00099 m.Append ( " " );
00100 m.Append( message );
00101 return m;
00102 }
|
|
||||||||||||
|
Log the destruction of an object.
Definition at line 115 of file NclLog.cpp. References NclBase::GetSerialNumberString(), and Line(). Referenced by NclSession::Clean(), NclFrame::Clean(), Mdo::~Mdo(), NclBase::~NclBase(), NclFileParser::~NclFileParser(), NclGridFromText::~NclGridFromText(), and NclTemplateClass::~NclTemplateClass().
00116 {
00117 wxString m = "#";
00118 m.Append ( " " );
00119 m.Append( base->GetSerialNumberString());
00120 m.Append ( " " );
00121 m.Append ( name );
00122 m.Append( " Destroyed.");
00123 Line( m );
00124 }
|
|
||||||||||||||||
|
Add two longs to the log, using the given format.
Definition at line 78 of file NclLog.cpp. References DateTime().
00079 {
00080 wxString m = DateTime( mIn );
00081 bool rv = true;
00082 int rl = fprintf( logFilePtr, "%s %d %d\n", m.c_str(), number1, number2 );
00083 if ( rl < 0 ) {
00084 rv = false;
00085 }
00086 return rv;
00087 }
|
|
||||||||||||
|
Add a long to the log, using the given format.
Definition at line 67 of file NclLog.cpp. References DateTime().
00068 {
00069 wxString m = DateTime( mIn );
00070 bool rv = true;
00071 int rl = fprintf( logFilePtr, "%s %d\n", m.c_str(), number );
00072 if ( rl < 0 ) {
00073 rv = false;
00074 }
00075 return rv;
00076 }
|
|
||||||||||||
|
Add a line to the log, using the given format.
Definition at line 56 of file NclLog.cpp. References DateTime().
00057 {
00058 wxString m = DateTime( mIn );
00059 bool rv = true;
00060 int rl = fprintf( logFilePtr, format, m.c_str() );
00061 if ( rl < 0 ) {
00062 rv = false;
00063 }
00064 return rv;
00065 }
|
|
|
Add a line as a string to the log.
Definition at line 45 of file NclLog.cpp. References DateTime(). Referenced by Clear(), NclSession::Close(), Creation(), Destruction(), Open(), NclFileManager::OpenGraphicFile(), NclFileManager::OpenTextFile(), NclFileManager::OpenXmlFile(), NclSession::SaveInCache(), NclSession::SaveInPlace(), NclGridFromText::SetNolColHeader(), NclGridFromText::SetNolHeader(), NclGridFromText::SetNolTrailer(), and ~NclLog().
00046 {
00047 wxString m = DateTime( mIn );
00048 bool rv = true;
00049 int rl = fprintf( logFilePtr, "%s\n", m.c_str() );
00050 if ( rl < 0 ) {
00051 rv = false;
00052 }
00053 return rv;
00054 }
|
|
|
Open the log. This also writes an opening declaration to the log along with the date and time. Definition at line 28 of file NclLog.cpp. References Line(). Referenced by NclLog().
00029 {
00030 logFilePtr = fopen( logFileName, "a" );
00031 wxString m = "++++++++++++++++++++++++++++++++++++++++++++";
00032 m.Append( "Open the log file." );
00033 Line( m );
00034 }
|
1.3.1 using KingsTools