You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

51 lines
1.2 KiB

  1. #! /usr/bin/env python
  2. """WSDL parsing services package for Web Services for Python."""
  3. ident = "$Id$"
  4. import WSDLTools
  5. import XMLname
  6. from ConfigParser import NoSectionError
  7. LOGGING = 'logging.txt'
  8. try:
  9. from logging import getLogger
  10. import logging
  11. except ImportError, ex:
  12. class logger:
  13. '''Default logger for python2.2
  14. '''
  15. def __init__(self, name):
  16. self.name = name
  17. self.out = out
  18. def write(self, arg):
  19. self.out.write(arg)
  20. def _write(self, severity, msg, *args, **kw):
  21. self.write('%s: %s -- %s' %(severity, self.name, msg))
  22. def error(self, msg, *args, **kw):
  23. self._write('ERROR', msg, *args, **kw)
  24. def warning(self, msg, *args, **kw):
  25. self._write('WARNING', msg, *args, **kw)
  26. def critical(self, msg, *args, **kw):
  27. self._write('CRITICAL', msg, *args, **kw)
  28. def getLogger(name):
  29. return logger(name)
  30. else:
  31. import logging.config
  32. try:
  33. logging.config.fileConfig(LOGGING)
  34. except (NoSectionError,), ex:
  35. logging.basicConfig()
  36. class Base:
  37. def __init__(self, module=__name__):
  38. self.logger = getLogger('%s-%s(%x)' %(module, self.__class__, id(self)))