Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Vous êtes un professionnel et vous avez besoin d'une formation ? Programmation Python
Les compléments
Voir le programme détaillé
Classe « LoggerAdapter » Python 3.13.2

Constructeur logging.LoggerAdapter.__init__

Signature de la constructeur __init__

def __init__(self, logger, extra=None, merge_extra=False) 

Description

help(LoggerAdapter.__init__)

Initialize the adapter with a logger and a dict-like object which
provides contextual information. This constructor signature allows
easy stacking of LoggerAdapters, if so desired.

You can effectively pass keyword arguments as shown in the
following example:

adapter = LoggerAdapter(someLogger, dict(p1=v1, p2="v2"))

By default, LoggerAdapter objects will drop the "extra" argument
passed on the individual log calls to use its own instead.

Initializing it with merge_extra=True will instead merge both
maps when logging, the individual call extra taking precedence
over the LoggerAdapter instance extra

.. versionchanged:: 3.13
   The *merge_extra* argument was added.


Vous êtes un professionnel et vous avez besoin d'une formation ? Deep Learning avec Python
et Keras et Tensorflow
Voir le programme détaillé