Developpez.com

Python

Choisissez la catégorie, puis la rubrique :

14.5.10.1 Configuration functions


14.5.10.1 Configuration functions

The following functions configure the logging module. They are located in the logging.config module. Their use is optional -- you can configure the logging module using these functions or by making calls to the main API (defined in logging itself) and defining handlers which are declared either in logging or logging.handlers.

fileConfig( fname[, defaults])
Reads the logging configuration from a ConfigParser-format file named fname. This function can be called several times from an application, allowing an end user the ability to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration). Defaults to be passed to ConfigParser can be specified in the defaults argument.

listen( [port])
Starts up a socket server on the specified port, and listens for new configurations. If no port is specified, the module's default DEFAULT_LOGGING_CONFIG_PORT is used. Logging configurations will be sent as a file suitable for processing by fileConfig(). Returns a Thread instance on which you can call start() to start the server, and which you can join() when appropriate. To stop the server, call stopListening(). To send a configuration to the socket, read in the configuration file and send it to the socket as a string of bytes preceded by a four-byte length packed in binary using struct.pack('>L', n).

stopListening( )
Stops the listening server which was created with a call to listen(). This is typically called before calling join() on the return value from listen().

See About this document... for information on suggesting changes.
Microsoft publie l'édition de juin 2019 de l'extension Python pour Visual Studio Code, elle inclut 70 correctifs et son lot de nouveautés
Le neuvième week-end de programmation de jeux vidéo sur Developpez.com
Programmation : une étude révèle les langages les plus voraces en énergie, Perl, Python et Ruby en tête, C, Rust et C++, les langages les plus verts
Apprendre les notions avancées en Cython, un tutoriel de Gabor Laszlo Hajba traduit par l'équipe de rédaction
Contacter le responsable de la rubrique Python

Partenaire : Hébergement Web