3.4.0
Logging functions.

Functions

TiglReturnCode tiglLogSetFileEnding (const char *ending)
 Sets the file ending for logging files. Default is "log". More...
 
TiglReturnCode tiglLogSetTimeInFilenameEnabled (TiglBoolean enabled)
 Enables or disables appending a unique date/time identifier inside the log file name (behind the file prefix). By default, the time identifier is enabled. More...
 
TiglReturnCode tiglLogSetVerbosity (TiglLogLevel level)
 Set the console verbosity level. More...
 
TiglReturnCode tiglLogToFileDisabled ()
 Disabled file logging. If a log file is currently opened by TiGL it will be closed. The log messages are printed to console. This is the default logging mechanism of TIGL. More...
 
TiglReturnCode tiglLogToFileEnabled (const char *filePrefix)
 Sets up the tigl logging mechanism to send all log messages into a file. More...
 
TiglReturnCode tiglLogToFileStreamEnabled (FILE *fp)
 Sets up the tigl logging mechanism to send all log messages into an already opened file. More...
 

Detailed Description

The following functions are used to customize the behaviour how messages are handled by TiGL. By default, only error messages and warnings are printed to the console.

In addition, TiGL can be told to write message into a log file using the function tiglLogToFileEnabled and tiglLogToFileStreamEnabled. By enabling file logging, other log messages than errors and warnings can be inspected. File logging is disabled by default.

In order to change the verbosity of the TiGL messages printed on console, use tiglLogSetVerbosity.

Function Documentation

◆ tiglLogSetFileEnding()

TiglReturnCode tiglLogSetFileEnding ( const char *  ending)

Sets the file ending for logging files. Default is "log".

This function has to be called before tiglLogToFileEnabled to have the desired effect.

Parameters
[in]endingFile ending of the logging file. Default is "log".
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NULL_POINTER if ending is NULL
  • TIGL_ERROR if some error occurred

◆ tiglLogSetTimeInFilenameEnabled()

TiglReturnCode tiglLogSetTimeInFilenameEnabled ( TiglBoolean  enabled)

Enables or disables appending a unique date/time identifier inside the log file name (behind the file prefix). By default, the time identifier is enabled.

This function has to be called before tiglLogToFileEnabled to have the desired effect.

Parameters
[in]enabledSet to true, if time identifier should be enabled.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_ERROR if some error occurred

◆ tiglLogSetVerbosity()

TiglReturnCode tiglLogSetVerbosity ( TiglLogLevel  level)

Set the console verbosity level.

This function shall be used change, what kind of logging information is displayed on the console. By default, only errors and warnings are printed on console.

Parameters
[in]levelVerbosity level for console messages.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_ERROR if some error occurred

◆ tiglLogToFileDisabled()

TiglReturnCode tiglLogToFileDisabled ( )

Disabled file logging. If a log file is currently opened by TiGL it will be closed. The log messages are printed to console. This is the default logging mechanism of TIGL.

Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_ERROR if some other error occurred

◆ tiglLogToFileEnabled()

TiglReturnCode tiglLogToFileEnabled ( const char *  filePrefix)

Sets up the tigl logging mechanism to send all log messages into a file.

Typically this function has to be called before opening any cpacs configuration. The console logging mechanism remains untouched.

Parameters
[in]filePrefixPrefix of the filename to be created. The filename consists of the prefix, a date and time string and the ending ".log".
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NULL_POINTER if filePrefix is NULL
  • TIGL_OPEN_FAILED if file can not be opened for writing
  • TIGL_ERROR if some other error occurred

◆ tiglLogToFileStreamEnabled()

TiglReturnCode tiglLogToFileStreamEnabled ( FILE *  fp)

Sets up the tigl logging mechanism to send all log messages into an already opened file.

In contrast to tiglLogToFileEnabled, the messages are appended to an already opened file. This file might be an already opened logging file set up by another library or program. The console logging mechanism remains untouched.

Typically this function has to be called before opening any cpacs configuration.

Parameters
[in]fpFile pointer to an already opened file.
Returns
  • TIGL_SUCCESS if no error occurred
  • TIGL_NULL_POINTER if fp is NULL , i.e. not opened for writing.
  • TIGL_ERROR if some other error occurred