The Trace utility functions
By passing the argument "-console" when launching MotionBuilder, it is possible to print formatted messages, as a printf would.
On Mac OSX / Linux, the strings are simply sent to stderr. Upon Python Editor open, those formatted messages will be forwarded to Python console as well.
Global trace detailed level (kFBNORMAL_TRACE by default) could be controlled via FBTraceSetLevel() / FBTraceGetLevel() functions, which affect all the trace output targets, User could use pythonidelib.SetTraceLevel() / GetTraceLevel() to further adjust python console's trace level as well (kFBNO_TRACE by default).
typedef void(* FBTraceStubFct) (unsigned int pLevel, const char *pStr) |
Trace Stub Function type define.
Definition at line 653 of file fbsystem.h.
Trace Level.
- Note
- there are value gap between CRITIICAL, NORMAL and ALL. SDK user could define custom trace level by providing in between values.
Enumerator |
---|
kFBNO_TRACE |
|
kFBCRITICAL_TRACE |
|
kFBNORMAL_TRACE |
|
kFBALL_TRACE |
|
Definition at line 614 of file fbsystem.h.
Register custom trace stub function.
- Parameters
-
pFct | Custom trace stub function. |
- Returns
- True if register successfully.
void ORSDK2018::FBTrace |
( |
const char * |
pFormatString, |
|
|
|
... |
|
) |
| |
This function prints useful debugging strings in the console with kFBNORMAL_TRACE output detailed level.
- Parameters
-
pFormatString | A printf-style format string, to use the following arguments in the list. |
- Warning
- There is currently a limitation which sets the maximum length of the resulting string to be limited to 2048 bytes.
-
Not thread safe, as an static array is used internally.
unsigned int ORSDK2018::FBTraceGetLevel |
( |
| ) |
|
Get Global Trace Detailed Level which affects all the output targets.
- Returns
- Current global trace detailed level.
- Note
- Python console trace current output level could be queried via pythonidelib.GetTraceLevel().
void ORSDK2018::FBTraceSetLevel |
( |
unsigned int |
pNewLevel | ) |
|
Set Global Trace Detailed Level which affects all the output targets.
- Parameters
-
pNewLevel | Any trace message with detailed level higher than this new level will be ignored, valid value range [kFBNO_TRACE, kFBALL_TRACE] |
- Note
- Python console trace current output level could be further adjusted via pythonidelib.SetTraceLevel().
void ORSDK2018::FBTraceWithLevel |
( |
unsigned int |
pLevel, |
|
|
const char * |
pFormatString, |
|
|
|
... |
|
) |
| |
This function prints useful debugging strings in the console.
- Parameters
-
pLevel | to control trace output detailed level, valid value range [kFBCRITICAL_TRACE, kFBALL_TRACE] |
pFormatString | A printf-style format string, to use the following arguments in the list. |
- Warning
- There is currently a limitation which sets the maximum length of the resulting string to be limited to 2048 bytes.
-
Not thread safe, as an static array is used internally.
Unregister custom trace stub function.
- Parameters
-
pFct | Custom trace stub function. |
- Returns
- True if un-register successfully.