StdoutJsonBackend

JSON output on stdout

class DIRAC.Resources.LogBackends.StdoutJsonBackend.StdoutJsonBackend(backendParams=None)

Bases: DIRAC.Resources.LogBackends.AbstractBackend.AbstractBackend

This just spits out the log on stdout in a json format.

__init__(backendParams=None)

Initialization of the backend. _handler and _formatter can be custom objects. If it is the case, you can find them in FrameworkSystem/private/standardLogging/Formatter or Handler.

Parameters
  • _handler – handler object from ‘logging’. Ex: StreamHandler(), FileHandler()…

  • _formatter – the name of a formatter object from logging. Ex: BaseFormatter

  • backendParams (dict) – parameters to set up the backend

  • _datefmt (str) – parameters to set up the formatter (e.g. fmt, the format, and datefmt, the date format)

  • _level (str) – level of the handler

getHandler()
Returns

the handler

setLevel(levelName)

Configure the level of the handler associated to the backend. Make sure the handler has been created before calling the method.

Parameters

level (int) – a level