GeoEco.Logging.Logger.LogInfoAndSetInfoToDebug

classmethod Logger.LogInfoAndSetInfoToDebug(format, *args)

Reports an informational message and then calls Logger.LogInfoAsDebug(True) and returns its value.

This function is used to efficiently implement a common logging scenario: a function wants to log one informational message announcing the processing it is doing and report everything else as debug messages, including informational messages reported by nested functions. The Python pattern for implementing this scenario is:

from GeoEco.Logging import Logger

def MyFunc(...):
    oldValue = Logger.LogInfoAndSetInfoToDebug('Doing my processing...')
    try:
        # Do your work here
    finally:
        Logger.SetLogInfoAsDebug(oldValue)
Parameters:
Returns:

The value returned by LogInfoAsDebug(), indicating whether or not informational messages were being logged as debug messages prior to this call.

Return type:

bool