Logging-config

Een wrapper-klasse voor de standaard logboekmodule Python Standaard
Download nu

Logging-config Rangschikking & Samenvatting

Advertentie

  • Rating:
  • Vergunning:
  • BSD License
  • Prijs:
  • FREE
  • Naam uitgever:
  • Gavin M. Roy
  • Uitgever website:
  • http://area51.myyearbook.com/trac.cgi/wiki/Staplr

Logging-config Tags


Logging-config Beschrijving

Logging-config is een Python-configuratie-wrapper-klasse voor het standaard Python-loggingpakket. Aangezien Dictconfigurator niet beschikbaar is tot 2.7 en ik nog toch 26 moet ondersteunen, wilde ik een consistente manier om de configuratie van applicatie-logging te hanteren. Ik heb geprobeerd om het Configuration Dictionary Schema zo veel te matchen als het logisch is om dit te doen. Voor meer informatie over de Configuration Dictionary Schema Check out http://docs.python.org/Library/Logging.config.html#logging-config-dictschema.example configuratie {'Loggers': {'pika': {'propagate' : True, 'Niveau': 'Info'}, 'Tinman': {'propagate': true, 'niveau': 'info'}}, 'Formatters': {'syslog': (% (LevelName) s ' '% (naam).% (FUNCNAME) S:% (bericht) S'), 'uitgebreide': ('% (LevelName) -10s% (Assimime) s% (naam) -30s'% (Funcname) - 25S:% (bericht) S ')},' Filters ': Geen,' Handlers ': {' Syslog ': {' Facility ':' Local6 ',' Level ':' Info ',' Formatter ':' Syslog ' , 'Class': 'Logging.Handlers.syslogHandler', 'Adres': '/ Var / Run / Syslog'}, 'Console': {'Formatter': 'uitgebreide', 'debug_only': True, 'Class': 'Logging.StreamHandler', 'niveau': 'Debug'}}} Voorbeeld Usegiven Een YAML-bestand "example.yaml":% YAML 1.2 --- Loggers: PIKA: Niveau: Info Propagate: True Tinman: Level: Info Propagate: True Bestand: Bestandsnaam: /Var/log/Example.log Klasse: Logging.rotatingFileHandler Mode: A MAXBYTES: 104857600 Backupcount: 6 Codering: UTF-8 D ELAY: FALSE FORTATE: uitgebreide filters: My_Logger: My_App. * Informateurs: uitgebreid: "% (LevelName) -10s% (Assimime) s% (naam) -30s% (FUNCNAME) -25S:% (bericht) S" SYSLOG: "% (LevelName) s% (naam).% (FUNCNAME) S:% (bericht) S" Handlers: console: klasse: logging.streamhandler formatter: uitgebreide debug_only: True Level: Debug Syslog: klasse: logging.Handlers.sysLogHandler Faciliteit: Local6 Adres: / VAR / RUN / SYSLOG FILTERS: FORTATE: SYSLOG LEVEL: INFOTHE NODIG DE CODE ZAL DE LOGKING MODULE INSTELLEN MET DE GESPARTE HANDELEN: IMPORT LOGKING_CONFIG IMPORT YAML met Open ('Voorbeeld.yaml', 'R' ) Als handvat: config = yaml.load (handvat) CFG = logging_config.logging (config) CFG.SETUP () Product's Homepage


Logging-config Gerelateerde software

jsonrpclib-ned14

Dit project is een implementatie van de SSON-RPC V2.0-specificatie (achterwaarts compatibel) als een klant ... ...

85

Downloaden