![]() | InDesign SDK 20.5 |
#include <LogObject.h>
Public Member Functions | |
| LogObject (const char *logFileName, bool16 newFile=kTrue, bool16 writeMemoryInfo=kTrue, bool16 autoflush=kFalse) | |
| LogObject (bool16 newFile, const char *logFileName, bool16 autoflush=kFalse) | |
| LogObject (IDFile pathAndName, bool16 newFile=kTrue, bool16 autoflush=kFalse) | |
| virtual | ~LogObject () |
| void | WriteLog (bool16 terminateLine, const char *format,...) |
| void | WriteLogFormat (const char *format, va_list argptr, bool16 terminateLine=kTrue) |
| void | WriteLog (const PMString &logString, bool16 terminateLine=kTrue) |
| void | WriteDateTime (bool16 terminateLine) |
| void | WriteElapsedTime (bool16 terminateLine) |
| void | WriteMemoryInfo () |
| void | WriteAvailableMemory () |
| void | WriteMemoryUsed () |
| void | WriteSeparator () |
| void | Indent () |
| void | UnIndent () |
| int16 | GetNumIndents () |
| void | Prepend (const PMString &prepend) |
| void | RemovePrepend () |
| void | SetWriteTrailer (bool16 writeTrailer) |
| PMString | GetLogFileName (void) |
| void | WriteInsert (const PMString &logString, CharCounter startPos) |
| void | WriteBasicHeader (const char *fileName) |
Static Public Member Functions | |
| static PMString | GetQAFileDir () |
| static PMString | GetLogFileDir () |
| static PMString | GetBenchmarkDataDir () |
| static PMString | GetPortDirName () |
LogObject allows a caller to create and write to a log, i.e., a text-only file, or append to an existing log.
The constructors use an "autoflush" setting. Before setting that to kTrue, consider the potential impact on performance. The default was changed to kFalse, in order to prevent the time-consuming writing to disk that formerly occurred on startup.
Some methods terminate lines. The terminator varies per platform.
Some methods indent lines. Indenting is accomplished by inserting a fixed number of spaces, sometimes referred to as a "tab."
| LogObject::LogObject | ( | const char * | logFileName, |
| bool16 | newFile = kTrue, | ||
| bool16 | writeMemoryInfo = kTrue, | ||
| bool16 | autoflush = kFalse | ||
| ) |
This constructor wraps an existing log file or creates a new one in a standard location.
| logFileName | The name of the file. The remainder of the path is as returned from GetLogFileDir(). |
| newFile | If kTrue, then the file is created. |
| writeMemoryInfo | If kTrue, then memory info is automatically written once into the log. |
| autoflush | If kTrue, then the underlying stream is automatically flushed every time a WriteFoo() method is called. |
| LogObject::LogObject | ( | bool16 | newFile, |
| const char * | logFileName, | ||
| bool16 | autoflush = kFalse | ||
| ) |
This constructor wraps an existing log file or creates a new one in a standard location, and it suppresses the standard header and trailer.
| newFile | If kTrue, then the file is created. |
| logFileName | The name of the file. The remainder of the path is as returned from GetLogFileDir(). |
| autoflush | If kTrue, then the underlying stream is automatically flushed every time a WriteFoo() method is called. |
| LogObject::LogObject | ( | IDFile | pathAndName, |
| bool16 | newFile = kTrue, | ||
| bool16 | autoflush = kFalse | ||
| ) |
This constructor wraps an existing log file or creates a new one in the specified location, and it suppresses the standard header and trailer.
| pathAndName | The name of the file. The remainder of the path is as returned from GetLogFileDir(). |
| newFile | If kTrue, then the file is created. |
| writeMemoryInfo | If kTrue, then memory info is automatically written into the log. |
| autoflush | If kTrue, then the underlying stream is automatically flushed every time a WriteFoo() method is called. |
| virtual |
The destructor writes the standard trailer according to the setting set by the constructor; flushes the underlying stream, if autoflush has not been specified; then, closes the stream.
| static |
Returns the location of the standard folder for storing output from benchmarking tests. For InDesign Server, this includes a subfolder named after the configuration.
| static |
Returns the location of the standard folder for storing logs. For InDesign Server, this includes a subfolder named after the configuration.
| PMString LogObject::GetLogFileName | ( | void | ) |
Returns the filename of the log.
| int16 LogObject::GetNumIndents | ( | ) |
Returns the measure of the current indent.
| static |
Returns the configuration name used by InDesign Server.
| static |
Returns the location of the QA folder, which is used to store various testing resources, including standard logs.
| void LogObject::Indent | ( | ) |
Increases the indent by one tab.
| void LogObject::Prepend | ( | const PMString & | prepend | ) |
Specifies a string to be appended automatically before the material specified in WriteLog().
| prepend | The string to append. |
| void LogObject::RemovePrepend | ( | ) |
Clears the string specified by Prepend().
| inline |
Turns on or off the flag that determines whether a trailer shall be written by the destructor.
| writeTrailer | If kTrue, a trailer is written. |
| void LogObject::UnIndent | ( | ) |
Reduces the indent by one tab.
| void LogObject::WriteAvailableMemory | ( | ) |
Appends data about available memory.
| void LogObject::WriteBasicHeader | ( | const char * | fileName | ) |
Writes the standard header information.
| fileName | The name to be used in the header to specify this log. |
| void LogObject::WriteDateTime | ( | bool16 | terminateLine | ) |
Appends the current date and time.
| terminateLine | If kTrue, a line terminator is further appended. |
| void LogObject::WriteElapsedTime | ( | bool16 | terminateLine | ) |
Appends the length of time since this object was constructed.
| terminateLine | If kTrue, a line terminator is further appended. |
| void LogObject::WriteInsert | ( | const PMString & | logString, |
| CharCounter | startPos | ||
| ) |
Inserts a string into the log at the specified position.
| logString | The string. |
| startPos | The position. |
| void LogObject::WriteLog | ( | bool16 | terminateLine, |
| const char * | format, | ||
| ... | |||
| ) |
Appends the specified text.
| terminateLine | If kTrue, a line terminator is further appended. |
| format | A "printf"-type string. |
| ... | Any variables called for by "format". |
| void LogObject::WriteLog | ( | const PMString & | logString, |
| bool16 | terminateLine = kTrue | ||
| ) |
Appends the specified string.
| logString | The string. |
| terminateLine | If kTrue, a line terminator is further appended. |
| void LogObject::WriteLogFormat | ( | const char * | format, |
| va_list | argptr, | ||
| bool16 | terminateLine = kTrue | ||
| ) |
Appends the specified text.
| format | A "printf"-type string. |
| argptr | Argument list, contains any variables called for by "format". |
| terminateLine | If kTrue, a line terminator is further appended. |
| void LogObject::WriteMemoryInfo | ( | ) |
Appends data about available memory and memory used since this object was constructed.
| void LogObject::WriteMemoryUsed | ( | ) |
Appends data about memory used since this object was constructed.
| void LogObject::WriteSeparator | ( | ) |
Appends a line of dashes.