The Trace utility functions

The Trace utility functions
+ この参照ページは、次の概要トピックと関連付けられています。

Module description

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).

Typedefs

typedef void(* FBTraceStubFct) (unsigned int pLevel, const char *pStr)
 Trace Stub Function type define. More...
 

Enumerations

enum  FBTraceLevel { kFBNO_TRACE = 0, kFBCRITICAL_TRACE = 1, kFBNORMAL_TRACE = 10, kFBALL_TRACE = 20 }
 Trace Level. More...
 

Functions

void FBTraceSetLevel (unsigned int pNewLevel)
 Set Global Trace Detailed Level which affects all the output targets. More...
 
unsigned int FBTraceGetLevel ()
 Get Global Trace Detailed Level which affects all the output targets. More...
 
void FBTrace (const char *pFormatString,...)
 This function prints useful debugging strings in the console with kFBNORMAL_TRACE output detailed level. More...
 
void FBTraceWithLevel (unsigned int pLevel, const char *pFormatString,...)
 This function prints useful debugging strings in the console. More...
 
bool FBRegisterTraceStubFct (FBTraceStubFct pFct)
 Register custom trace stub function. More...
 
bool FBUnRegisterTraceStubFct (FBTraceStubFct pFct)
 Unregister custom trace stub function. More...
 

Typedef Documentation

typedef void(* FBTraceStubFct) (unsigned int pLevel, const char *pStr)

Trace Stub Function type define.

Definition at line 653 of file fbsystem.h.

Enumeration Type Documentation

enum FBTraceLevel

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.

615  {
616  kFBNO_TRACE = 0, //<! Tracing disabled
617  kFBCRITICAL_TRACE = 1, //<! Critical traces
618  kFBNORMAL_TRACE = 10, //<! Descriptive traces
619  kFBALL_TRACE = 20 //<! Default value, all traces.
620  };

Function Documentation

bool ORSDK2018::FBRegisterTraceStubFct ( FBTraceStubFct  pFct)

Register custom trace stub function.

Parameters
pFctCustom 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
pFormatStringA 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.
+ Examples:
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
pNewLevelAny 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
pLevelto control trace output detailed level, valid value range [kFBCRITICAL_TRACE, kFBALL_TRACE]
pFormatStringA 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.
bool ORSDK2018::FBUnRegisterTraceStubFct ( FBTraceStubFct  pFct)

Unregister custom trace stub function.

Parameters
pFctCustom trace stub function.
Returns
True if un-register successfully.