Typedefs | Enumerations | Functions

The Trace utility functions

This reference page is linked to from the following overview topics: MotionBuilder 2014.


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

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

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

Trace Stub Function type define.

Definition at line 1710 of file fbsystem.h.


Enumeration Type Documentation

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 1671 of file fbsystem.h.

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

Function Documentation

FBSDK_DLL 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().
FBSDK_DLL 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().
FBSDK_DLL 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.
FBSDK_DLL 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.
FBSDK_DLL bool FBRegisterTraceStubFct ( FBTraceStubFct  pFct)

Register custom trace stub function.

Parameters:
pFctCustom trace stub function.
Returns:
True if register successfully.
FBSDK_DLL bool FBUnRegisterTraceStubFct ( FBTraceStubFct  pFct)

Unregister custom trace stub function.

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