Skip to content
On this page

Logging

If you run into issues when using Simplygon you should always check the log for clues.
You can access the log in following ways:

Log to stdout

If you want to get the log from stdout you should enable logging as soon as you initialize the Simplygon interface.

cpp
// Enable logging, will default to stdout
sg->SetGlobalEnableLogSetting( true );

// Run processing here...
csharp
// Enable logging, will default to stdout
sg.SetGlobalEnableLogSetting( true );

// Run processing here...
python
# Enable logging, will default to stdout
sg.SetGlobalEnableLogSetting( True )

# Run processing here...

Log to file

If you want to get the log from a file you should enable logging as soon as you initialize the Simplygon interface.

Log to default log file

If no log file is specified the log will be written to default log file %SIMPLYGON_10_SHARED\Simplygon.log

cpp
// Enable logging and send the log to the default file (%SIMPLYGON_10_SHARED\Simplygon.log%)
sg->EnableLogToFile( Simplygon::ELogLevel::Info, Simplygon::ELogDecoration::Timestamp |
                                                 Simplygon::ELogDecoration::Thread | 
                                                 Simplygon::ELogDecoration::Category );

// Run processing here...
csharp
// Enable logging and send the log to the default file (%SIMPLYGON_10_SHARED\Simplygon.log%)
sg.EnableLogToFile( Simplygon.ELogLevel.Info, (uint)(Simplygon.ELogDecoration.Timestamp |
                                                     Simplygon.ELogDecoration.Thread |
                                                     Simplygon.ELogDecoration.Category) );


// Run processing here...
python
# Enable logging and send the log to the default file (%SIMPLYGON_10_SHARED\Simplygon.log%)
sg.EnableLogToFile( Simplygon.ELogLevel_Info, Simplygon.ELogDecoration_Timestamp |
                                              Simplygon.ELogDecoration_Thread | 
                                              Simplygon.ELogDecoration_Category )


# Run processing here...

Log to specified log file

If a log file path is provided, the log will be written to specified log file.

cpp
// Enable logging and send the log to a specified file
sg->EnableLogToFile( Simplygon::ELogLevel::Info, Simplygon::ELogDecoration::Timestamp |
                                                 Simplygon::ELogDecoration::Thread | 
                                                 Simplygon::ELogDecoration::Category,
                                                 "C:\\temp\\Simplygon.log" );

// Run processing here...
csharp
// Enable logging and send the log to a specified file
sg.EnableLogToFile( Simplygon.ELogLevel.Info, (uint)(Simplygon.ELogDecoration.Timestamp |
                                                     Simplygon.ELogDecoration.Thread |
                                                     Simplygon.ELogDecoration.Category),
                                                     "C:\\temp\\Simplygon.log" );


// Run processing here...
python
// Enable logging and send the log to a specified file
sg.EnableLogToFile( Simplygon.ELogLevel_Info, Simplygon.ELogDecoration_Timestamp |
                                              Simplygon.ELogDecoration_Thread | 
                                              Simplygon.ELogDecoration_Category,
                                              'C:\\temp\\Simplygon.log' )


# Run processing here...