equal
deleted
inserted
replaced
20 import sys, os, logging |
20 import sys, os, logging |
21 from StringIO import StringIO |
21 from StringIO import StringIO |
22 from urllib import quote as urlquote, unquote as urlunquote |
22 from urllib import quote as urlquote, unquote as urlunquote |
23 |
23 |
24 from logilab.common.decorators import cached |
24 from logilab.common.decorators import cached |
25 |
25 from logilab.common.logging_ext import set_log_methods |
26 def set_log_methods(cls, logger): |
|
27 """bind standart logger's methods as static methods on the class |
|
28 """ |
|
29 cls._logger = logger |
|
30 for attr in ('debug', 'info', 'warning', 'error', 'critical', 'exception'): |
|
31 setattr(cls, attr, getattr(logger, attr)) |
|
32 |
26 |
33 if os.environ.get('APYCOT_ROOT'): |
27 if os.environ.get('APYCOT_ROOT'): |
34 logging.basicConfig(level=logging.CRITICAL) |
28 logging.basicConfig(level=logging.CRITICAL) |
35 else: |
29 else: |
36 logging.basicConfig() |
30 logging.basicConfig() |