Open Reality Reference Guide
 
Loading...
Searching...
No Matches
The Trace utility functions

By passing the argument "-console" when launching MotionBuilder, it is possible to print formatted messages, as a printf would. More...

Typedefs

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

Enumerations

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

Functions

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

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

Typedef Documentation

◆ FBTraceStubFct

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

Trace Stub Function type define.

Definition at line 681 of file fbsystem.h.

Enumeration Type Documentation

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

Definition at line 642 of file fbsystem.h.

Function Documentation

◆ FBRegisterTraceStubFct()

K_DLLIMPORT bool FBRegisterTraceStubFct ( FBTraceStubFct  pFct)

Register custom trace stub function.

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

◆ FBTrace()

K_DLLIMPORT void 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.

◆ FBTraceGetLevel()

K_DLLIMPORT unsigned int 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().

◆ FBTraceSetLevel()

K_DLLIMPORT void 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().

◆ FBTraceWithLevel()

K_DLLIMPORT void 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.

◆ FBUnRegisterTraceStubFct()

K_DLLIMPORT bool FBUnRegisterTraceStubFct ( FBTraceStubFct  pFct)

Unregister custom trace stub function.

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