pyworkflow.utils.log module

Module to handle default logging configuration and custom one. Default logging configuration is defined here but optionally, it can be configured with an external json file containing a standard python logging configuration content as documented here: https://docs.python.org/3/howto/logging-cookbook.html#an-example-dictionary-based-configuration To specify a custom logging config file use SCIPION_LOG_CONFIG variable to a json logging configuration file If you just want to change the logger devel use SCIPION_LOG_LEVEL variable (defaults to INFO) See https://docs.python.org/3/howto/logging.html#logging-levels for available levels. Use the literal! not de value.

class pyworkflow.utils.log.LoggingConfigurator[source]

Bases: object

Class to configure logging scenarios:

1.- GUI logging

2.- Protocol run logging

customLoggingActive = False
classmethod loadCustomLoggingConfig()[source]

Loads the custom logging configuration file

classmethod setUpGUILogging()[source]

Sets up the logging library for the GUI processes: By default all goes to SCIPION_LOG file and console.

classmethod setUpProtocolRunLogging(stdoutLogFile, stderrLogFile)[source]

Sets up the logging library for the protocols run processes, loads the custom configuration plus 2 FileHandlers for stdout and stderr

static setupDefaultLogging()[source]
classmethod setupLogging()[source]
class pyworkflow.utils.log.STATUS[source]

Bases: object

EVENT = 'EVENT'
INTERVAL = 'INTERVAL'
START = 'START'
STOP = 'STOP'
pyworkflow.utils.log.getExtraLogInfo(measurement, status, project_name=None, prot_id=None, prot_name=None, step_id=None, duration=None, dbfilename=None)[source]
pyworkflow.utils.log.getFinalProjId(projId)[source]
pyworkflow.utils.log.getFinalProtId(protId)[source]
pyworkflow.utils.log.restoreStdoutAndErr()[source]
pyworkflow.utils.log.setDefaultLoggingContext(protId, projId)[source]