The API
- API Overview
Getting Started Logging,Samples
- The Command Line Interface
API Overview,Getting Started Logging, Samples
- The COM Interface
API Overview,Getting Started Logging, Samples
- The COM Interface – PBLogger
COM Interface Overview,What’s a Log Message ,Samples
- The COM Interface – PBScopeLogger
COM Interface Overview,What’s a Log Message ,Samples
- The C and C++ API
API Overview,Getting Started Logging, Samples
- Logging a Message
C and C++ API Overview,Getting Started Logging, Samples
- Working with Components and Contexts
C and C++ API Overview,Components and Contexts Overview, Samples
- Initialization, Diagnostics, and Miscellaneous
PBInitialize is provided as a diagnostic and as a performance enhancement. It is normally called implicitly the first time you call any of the API functions and as…
- Preprocessor Macros
In the C and C++ API we use a fair number of preprocessor macros and define constants. They are listed below.
- PB_DEBUG_LEVEL
The preprocessor macro PB_DEBUG_LEVEL is used to create conditionally compiled code in a manner somewhat similar to the standard DEBUG macro with the major difference being that it…
- Filename String Pooling (PB_THIS_FILE)
All of the logging calls have the source code’s filename passed in to them. This string ultimately comes from the preprocessor’s expansion of the __FILE__ macro via the…
- Location Macros (PB_LOC_***)
The following preprocessor macros are used to manage location information (filenames and line numbers) for the logging calls. The various forms work together to provide consistency when prototyping…
- Location / Message Type Macros (PB_VERBOSE, PB_INFO, …)
The location / message type preprocessor macros are used when invoking logging calls or wrapper functions that pass location and message type information through to logging calls. They…
- PB_DEFAULT_EXCLUDE
The PB_DEFAULT_EXCLUDE preprocessor macro is used as a default argument for the constructors of the CPBComponent, CPBContext, and CPBLogger classes. They accept exclusion flags that govern which messa…
- ENSURE and VALIDATE
The ENSURE and VALIDATE preprocessor macros are used in similar fashion to MFC's VERIFY and ASSERT macros respectively but with the following differences (features):
- PBInitialize
Returns TRUE if initialization succeeds (or has already succeeded on a previous call) else FALSE. Note that a return of FALSE may only indicate that Paul Bunyan is…
- PBUninitialize
dwMilliseconds Maximum time to wait for other threads to complete their work before aborting cleanup.
- PBGetLibVersion
Returns a ULONG that is interpreted as follows:
- PBGetFailCount
Returns the number of errors since the process was created or since the last call.
- PBSetUnhandledExceptionFilter
pfnExceptionFilter Pointer to a function to execute when an unhandled exception occurs.
- PBSetComponent and PBSetContext
Components and Contexts Overview,Working With Components and Contexts
- PBSetDefaultComponent and PBSetDefaultContext
Components and Contexts Overview,Working With Components and Contexts
- PBLog
C and C++ API Overview,What’s a Log Message,Samples
- Class CPBComponent
Components and Contexts Overview, Working With Components and Contexts
- Class CPBContext
Components and Contexts Overview,Working With Components and Contexts
- Class CPBLogger
C and C++ API Overview,What’s a Log Message,Samples
- Class CPBScopeLogger
C and C++ API Overview,What’s a Log Message,Samples
- CPBComponent::CPBComponent
ulNameStringId String table resource identifier of string that will be used for the szName field of the underlying PB_COMPONENT structure.
- CPBComponent::Enable
The previous value of the blEnable field.
- CPBComponent::operator PB_COMPONENT*
The address of the underlying PB_COMPONENT structure.
- CPBComponent::SetExclude
The previous value of the ulExclude field.
- CPBComponent::SetMessageKey
Calls PBSetComponent to change the szMessageKey field of the underlying PB_COMPONENT structure.
- CPBComponent::SetName
Calls PBSetComponent to change the szName field of the underlying PB_COMPONENT structure.
- CPBContext::CPBContext
ulNameStringId String table resource identifier of string that will be used for the szName field of the underlying PB_CONTEXT structure.
- CPBContext::Enable
The previous value of the blEnable field.
- CPBContext::operator PB_CONTEXT*
The address of the underlying PB_CONTEXT structure.
- CPBContext::SetExclude
The previous value of the ulExclude field.
- CPBContext::SetName
Calls PBSetContext to change the szName field of the underlying PB_CONTEXT structure.
- CPBLogger::CPBLogger
pcp Pointer to PB_COMPONENT structure to be used explicitly on calls to the Log member function. Overrides use of default component for all logging by this object.
- CPBLogger::Enable
The previous value of the blEnable flag.
- CPBLogger::Log
Note that in the above prototypes the location macro PB_LOC_ARGS expands to PC[W]STR pszFile, ULONG ulLine.
- CPBLogger::SetExclude
The previous value of the ulExclude flags.
- CPBScopeLogger::CPBScopeLogger
Note that in the above prototypes the location macro PB_LOC_ARGS expands to PC[W]STR pszFile, ULONG ulLine.
- Error Handling and Notification
Each of the interfaces trap exceptions that occur from using them, e.g. passing bad pointers to logging functions. They are caught and handled by Paul Bunyan so that…
- Initialization and shutdown
All API functions and interfaces initialize themselves implicitly whenever the first API call that requires initialization is made. The C/C++ API additionally supports manual initialization for diagno…
- PBLogger::Component
```
- PBLogger::Context
```
- PBLogger::Enable
```
- PBLogger::Exclude
```
- PBLogger::File
```
- PBLogger::Log
```
- PBLogger::MessageKey
The PBLogger Object,Security
- PBLogger::Module
```
- PBLogger::NoReturnCodes
The PBLogger Object,Security
- PBScopeLogger::NoReturnCodes
The PBScopeLogger Object,Security
- PBScopeLogger::Set
```
- Security
In the C/C++ API, security is tied to the component with the idea that a vendor will likely want to lock up log messages on a per component…
- Structures
Components and Contexts Overview,Working With Components and Contexts
- Typedefs and header file inclusion
The following #define constants govern the inclusion of the CRT and Win32 header files and the manual definition of the data types. This functionality is provided to allow…
