Public Types | |
enum | BS_TRACE_MODE { BS_REPORT_NONE = 0x0000, BS_REPORT_INFORMATION = 0x0001, BS_REPORT_WARNING = 0x0002, BS_REPORT_ERROR = 0x0004, BS_REPORT_FATAL_ERROR = 0x0008, BS_REPORT_DEBUG_INFO = 0x0010, BS_REPORT_SYS_EXCEPTION_INFO = 0x0020, BS_REPORT_BS_EXCEPTION_INFO = 0x0040, BS_REPORT_MFC_EXCEPTION_INFO = 0x0080, BS_REPORT_STL_EXCEPTION_INFO = 0x0100, BS_REPORT_USER_EXCEPTION_INFO = 0x0200, BS_REPORT_VERBOSE = BS_REPORT_DEBUG_INFO, BS_REPORT_ALL = 0xffff, BS_REPORT_ALL_EXCEPTIONS, BS_REPORT_ERORRS_AND_HIGHER = BS_REPORT_ALL_EXCEPTIONS|BS_REPORT_FATAL_ERROR|BS_REPORT_ERROR, BS_REPORT_WARNING_AND_HIGHER = BS_REPORT_ERORRS_AND_HIGHER|BS_REPORT_WARNING, BS_REPORT_INFORMATION_AND_HIGHER = BS_REPORT_WARNING_AND_HIGHER|BS_REPORT_INFORMATION, BS_REPORT_DEFAULT = BS_REPORT_ALL } |
enum | BS_TRACE_OUTPUT { BS_OUTPUT_NONE = 0x00, BS_OUTPUT_FILE = 0x01, BS_OUTPUT_SOCKET = 0x02, BS_OUTPUT_EVENT_VIEW = 0x04, BS_OUTPUT_DEBUG_WINDOW = 0x08, BS_OUTPUT_CONSOLE = 0x10, BS_OUTPUT_DEFAULT = BS_OUTPUT_DEBUG_WINDOW } |
enum | BS_TRACE_TIME { BS_LOCAL_TIME = 1, BS_GMT_TIME = 2, BS_DEFAULT_TIME = BS_LOCAL_TIME } |
typedef BOOL(* | FP_SOCKET_HOOK )(LPSOCKET_HOOK) |
typedef CBS_Trace::SocketHook_st * | LPSOCKET_HOOK |
A structure that will be passed with the socket hook callback function. | |
typedef CBS_Trace::SocketHook_st | SOCKET_HOOK |
A structure that will be passed with the socket hook callback function. | |
Public Member Functions | |
BOOL | AttachFile (LPCTSTR lpNewFile) |
CBS_Trace () | |
BOOL | ChangeFile (LPCTSTR lpNewFile, LPCTSTR lpCloseComment=NULL) |
long | CloseControlDlg () |
BOOL | ConnectServer (DWORD dwIP, WORD wPort, BOOL bEnable=TRUE) |
BOOL | ConnectServer (LPCTSTR lpIP, WORD wPort, BOOL bDNSName, BOOL bEnable=TRUE) |
BOOL | CopyTraceFile (LPCTSTR lpNewFile) |
DECLARE_DLL_OPERATORS (CBS_Trace::BS_TRACE_OUTPUT, GSUPPORT_IMP_EXP_DECL) | |
DECLARE_DLL_OPERATORS (CBS_Trace::BS_TRACE_MODE, GSUPPORT_IMP_EXP_DECL) | |
DECLARE_SET_GET_MODE (CBS_Trace::BS_TRACE_OUTPUT, m_stoOutput, Output) | |
DECLARE_SET_GET_MODE (CBS_Trace::BS_TRACE_MODE, m_stmReportMode, Report) | |
BOOL | DeregisterEventSource () |
BOOL | DeregisterExternEventSource (HANDLE hEventSource) |
BOOL | DetachFile (LPCTSTR lpReason=BS_TRACE_UNSPECIFIED) |
BOOL | DisconnectServer () |
DWORD | FormatError (LPTSTR lpBuffer, DWORD dwBufLen) |
void | FreeResources () |
DWORD | GetDefaultEventID () |
long | GetFileMaxSize (char *pBuf, long lBufSize) |
long | GetFileMaxSize () |
BS_TRACE_ERRORS | GetLastError () |
LPCTSTR | GetLastErrorString (BS_TRACE_ERRORS steError) |
LPCTSTR | GetMillisecondDelimiter () |
BOOL | GetPrintFileName () |
LPCTSTR | GetReportTypeString (BS_TRACE_MODE) |
SOCKET | GetSocket () |
FP_SOCKET_HOOK | GetSocketHook () |
virtual void | GetTime (LPSYSTEMTIME lpSystemTime) |
LPCTSTR | GetTraceDateFormat () |
LPCTSTR | GetTraceFileName () |
LPCTSTR | GetTraceTimeFormat () |
BS_TRACE_TIME | GetUsedTime () |
BOOL | HaveEventSource () |
BOOL | HaveFile () |
BOOL | HaveSocket () |
BOOL | IsOutputSupported (BS_TRACE_OUTPUT sto) |
BOOL | IsSystemError (BS_TRACE_ERRORS steError) |
BOOL | OpenControlDlg (HWND hParent) |
BOOL | RegisterEventSource (LPCTSTR lpSourceName) |
BOOL | RegisterEventSource (LPCTSTR lpServerName, LPCTSTR lpSourceName) |
HANDLE | RegisterExternEventSource (LPCTSTR lpSourceName) |
HANDLE | RegisterExternEventSource (LPCTSTR lpServerName, LPCTSTR lpSourceName) |
SOCKET | RemoveSocket () |
BOOL | ReportEvent (WORD wType, DWORD dwEventID, LPCTSTR lpString=NULL) |
BOOL | ReportEvent (WORD wType, DWORD dwEventID, LPCTSTR *lpStrings, WORD wNumberOfStrings, DWORD dwDataSize=0, LPVOID lpRowData=NULL) |
BOOL | ReportExternEvent (HANDLE hEventSource, WORD wType, DWORD dwEventID, LPCTSTR lpString=NULL) |
BOOL | ReportExternEvent (HANDLE hEventSource, WORD wType, DWORD dwEventID, LPCTSTR *lpStrings, WORD wNumberOfStrings, DWORD dwDataSize=0, LPVOID lpRowData=NULL) |
BOOL | ReportMessage (BS_TRACE_MODE stmType, LPCTSTR lpFileName, UINT nLine, LPCTSTR lpModuleName, LPTSTR lpMessage,...) |
BOOL | ReportMessage (BS_TRACE_MODE stmType, LPCTSTR lpModuleName, LPTSTR lpMessage,...) |
BOOL | SetDateFormat (LPCTSTR lpDateFormat) |
void | SetDefaultEventID (DWORD dwEventID) |
BOOL | SetFileMaxSize (LPCTSTR lpcMaxSize) |
void | SetFileMaxSize (DWORD dwMaxSize) |
void | SetLastError (BS_TRACE_ERRORS steError) |
void | SetMillisecondDelimiter (LPCTSTR lpMilliSecondDelimiter) |
void | SetPrintFileName (BOOL bPrint) |
SOCKET | SetSocket (SOCKET socket, BOOL bEnable=TRUE) |
void | SetSocketHook (FP_SOCKET_HOOK fpSocketHook, LPVOID lpAppData) |
BOOL | SetTimeFormat (LPCTSTR lpTimeFormat) |
void | UseGMTTime () |
void | UseLocalTime () |
virtual | ~CBS_Trace () |
Static Public Member Functions | |
DWORD | GetSysErrorString (int iError, LPTSTR lpBuf, DWORD dwBufLen) |
LPCSTR | GetWSAErrorString (int iWSAError) |
|
An application defined callback that will be invoked if writing to the socket was not success. If this funtion return TRUE, the trace will retry to send the data else the writing to the socket function will terminate with failures. |
|
|
Enumeration of the supported output target.
|
|
Enumeration of the time that should be use in the formatted message. |
|
Constructor |
|
Destructor |
|
Attach a file to the object. If the file exists the messages will be appended. If the file size is bigger then the maximal size (see SetFileMaxSize()) the file will be overwritten. If the file does not exists, a new file will be created.
|
|
Changes the file that is currently attached to the object.
|
|
Closes the the settings controls dialox box of the current object.
|
|
Connecting a remote server. This method is very usfull if one wants to write all output to a remote server.
|
|
Connecting a remote server. This method is very usfull if one wants to write all output to a remote server.
|
|
Copies the currently attached file to a new file.
|
|
Declares the operators &=, |=, & and | for the enum member CBS_Trace::BS_TRACE_OUTPUT in order to avoid compiler error (or casting). |
|
Declares the operators &=, |=, & and | for the enum member CBS_Trace::BS_TRACE_MODE in order to avoid compiler error (or casting). |
|
Declares the folowing members function for manipulating the enum member m_stoOutput:
|
|
Declares the folowing members function for manipulating the enum member m_stmReportMode:
|
|
Deregister the event source used by the current object.
|
|
Deregister an extern event source.
|
|
Detaches the file attached to the object. The closure reason will be written to the file.
|
|
Disconnects the socket associated with the object. If the application wishes to keep the socket handle valid, it should invoke RemoveSocket(). In this case, however, the application should call alsow WIN32 API WSAStartup.
|
|
Format the last BS_Trace error into a string. If the last error involves a system error, the system error will be formatted as well.
|
|
If an application declares the Trace object on the stack so that CBS_GSupport::FreeGSupportLib() will be invoked before the object's destructore invoked, CBS_ResTrack will report resources failures. To avoid this, the application should invoke this method for freeing the resources explicitly. The application must not use the object after this function is called!!!!!
|
|
See return.
|
|
Formats the max size of the file into pBuf.
|
|
|
|
See return.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
Retrieve an error string describing a system error number.
|
|
Get the local or GMT time, depend on the setting of the current object.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
Return a string describing the WSA error saved in iWSAError. This static function is here since the trace searches WSA error if a system error returned by GetLastError is not found in the system error tables. Up to Win 2000 this errors are included in the system error table so this function wont have any use.
|
|
See return.
|
|
See return.
|
|
See return.
|
|
Check if a given output is supported (e.g. if no file is associated with the object, then file output is not possible).
|
|
System error are errors that where caused by calling an OS API. An application could call the WIN32 API GetLastError() to retrieve more detail to the error.
|
|
Opens a dialog box that controls the settings of the current object and provides extern access to some of trace functionality like changing the associated file, starting the mole and more.
|
|
Associate the object with a new event source handle, not like RegisterExternEventSource() this method keeps the handle and writes direct with that handle to the event log. The function calls RegisterEventSource( LPCTSTR lpServerName, LPCTSTR lpSourceName ) with lpServerName = NULL.
|
|
Registers an event source.
|
|
Opens a handle to a given event log. The function calls RegisterEventSource( LPCTSTR lpServerName, LPCTSTR lpSourceName ) with lpServerName = NULL.
|
|
Register an event source. Some modules wants to have a multiple event source. This function open a handle to a require event source and return this to the calling module.
|
|
Removes the currently set socket from the object.
|
|
Reports an event to the event source associated with the current object.
|
|
Report a message to the event log using the event handle of the current object.
|
|
Writes a message to the event log. This function invokes ReportExternEvent( HANDLE hEventSource, WORD wType, DWORD dwEventID, LPCTSTR *lpStrings, WORD wNumberOfStrings, DWORD dwDataSize, LPVOID lpRowData ) with wNumberOfStrings = 1, if lpString is not NULL, otherwise with wNumberOfStrings = 0.
|
|
Writes a message to the event log using extern event handle (hEventSource).
|
|
Reports a message to the available outputs.
|
|
Reports a message to the available outputs.
|
|
Sets an application defined data format.
|
|
Sets a default event ID. If the event is set and the object is associated with a valid event log handle and the output flag BS_OUTPUT_EVENT_VIEW is set to m_stoOutput, all messages will be printed to the event log using that handle and event ID.
|
|
Set the maximal size of the file associated with the object. When the file is attached to the trace, the size will be compare, if the size of the file exeeded, its size will be reset to 0.
|
|
Set the maximal size of the file associated with the object. When the file is attached to the trace, the size will be compare, if the size of the file exeeded, its size will be reset to 0.
|
|
Sets the last error to the object, the error is object and thread specific.
|
|
Sets the millisecond delimiter (the default is '.').
|
|
Tell the current object if it should print the file name with the message or not.
|
|
Sets a socket handle to the current object.
|
|
Sets the application socket hook function pointer to the current object. This callback function will be invoked if an error occurred when the trace tries to write data to the socket.
|
|
Sets an application defined time format.
|
|
Set the time to use flag to the GMT time.
|
|
Set the time to use flag to the local time.
|
Bitspot AG |
||
Phone: |
+41 41 755 11 22 |
|
Fax: |
+41 41 755 11 31 |
|
e-mail: |
||
Web: |
||