All Samples(1605) | Call(1319) | Derive(0) | Import(286)
Log a message with severity 'WARNING' on the root logger.
def warning(msg, *args, **kwargs):
"""
Log a message with severity 'WARNING' on the root logger.
"""
if len(root.handlers) == 0:
basicConfig()
root.warning(msg, *args, **kwargs)
while True:
logging.debug("debug message")
logging.info("info message")
logging.warn("warn message")
logging.error("error message")
logging.fatal("fatal message")
time.sleep(1)
src/e/n/EnthoughtBase-3.0.5/examples/logger_demo.py EnthoughtBase(Download)
def _test(self, n=2000):
for i in range(n):
logging.warn('foo %r', i)
def _test_timing(self, n=2000):
t = time.time()
for i in range(1,n+1):
if not (i%100):
t2 = time.time()
print '%1.2f s for 100 logs' % (t2-t)
t = t2
logging.warn('foo %r', i)
src/v/e/vertebra-py-HEAD/lib/vertebra/scheduler/scheduler.py vertebra-py(Download)
from select import select from vertebra.util import StablePrioQueue,Full,Empty from weakref import ref,WeakKeyDictionary,WeakValueDictionary from logging import warn,error,debug from vertebra.scheduler.sentinel import BaseSentinelHandler from vertebra.scheduler.handler import Handler,NoneHandler,ExceptionHandler from vertebra.scheduler.task import TaskHandler,Task
if handler.handle(self,task,ret):
return
except:
warn("handler %s crashed handling %s from %s",
handler,ret,task,exc_info=True)
warn("unhandled %s from %s",ret,task)
return
src/v/e/vertebra-py-HEAD/lib/vertebra/scheduler/handler.py vertebra-py(Download)
from logging import warn
class Handler(object):
TYPES = () # NOTE: THIS MUST BE A TUPLE, NO LISTS!
def handle(self,scheduler,task,ret): # returns True if handled
return False
class NoneHandler(Handler):
TYPES = ( type(None), )
def handle(self,scheduler,task,nothin):
warn("%r task %r didn't return any instructions, cancelled",
def handle(self,scheduler,task,exc):
warn("%r: task %r raised exception %r",scheduler,task,exc,exc_info=True)
src/v/e/vertebra-py-HEAD/lib/vertebra/agent.py vertebra-py(Download)
from __future__ import with_statement from threading import Thread,Condition from vertebra.job import job from vertebra.config import config from logging import debug,info,warn from types import ModuleType,StringTypes import fibra
def recv(self,msg):
warn("can't handle message: %r" % msg)
class agent(base_agent):
"""Vertebra Agent Implementation"""
def __init__(self):
super(agent,self).__init__()
try:
self.load_actor(actor)
except:
warn("unable to load %s",actor,exc_info=True)
info("done loading actors")
# Start Communications
src/v/e/vertebra-py-HEAD/lib/vertebra/conn/base.py vertebra-py(Download)
""" from threading import Thread,currentThread from logging import debug,info,error,warn from time import sleep from socket import error as socket_error from backoff import exponential_backoff
def recv(self,rawmsg):
try:
u = self.codec.unmarshall(rawmsg)
except MarshalError:
warn("failed to unmarshall raw message %s",rawmsg,exc_info=True)
else:
r = self.router
def sink(self,X):
warn('sinking unused data: %r',X)
return True
class threadedConnection(baseConnection):
def setup(self,config,name="ThreadedConnection"):
super(threadedConnection,self).setup(config,name)
src/s/u/sutekh-HEAD/releases/stable-branches/0.8.x/sutekh/gui/PluginManager.py sutekh(Download)
mPlugin = __import__("sutekh.gui.plugins.%s" % sPluginName,
None, None, [plugins])
except ImportError, oExp:
logging.warn("Failed to load plugin %s (%s).",
sPluginName, oExp, exc_info=1)
continue
# find plugin class
try:
cPlugin = mPlugin.plugin
except AttributeError, oExp:
logging.warn("Plugin module %s appears not to contain a"
src/s/u/sutekh-HEAD/trunk/sutekh/sutekh/gui/PluginManager.py sutekh(Download)
mPlugin = __import__("sutekh.gui.plugins.%s" % sPluginName,
None, None, [plugins])
except ImportError, oExp:
logging.warn("Failed to load plugin %s (%s).",
sPluginName, oExp, exc_info=1)
continue
# find plugin class
try:
cPlugin = mPlugin.plugin
except AttributeError, oExp:
logging.warn("Plugin module %s appears not to contain a"
src/a/u/autokey-HEAD/trunk/src/lib/autokey.py autokey(Download)
try:
callback(*args)
except Exception:
logging.warn("callback event failed: %r %r", callback, args, exc_info=True)
def postEventWithCallback(self, callback, *args):
self.queue.put((callback, args))
src/s/u/sutekh-HEAD/sutekh/sutekh/gui/PluginManager.py sutekh(Download)
mPlugin = __import__("sutekh.gui.plugins.%s" % sPluginName,
None, None, [plugins])
except ImportError, oExp:
logging.warn("Failed to load plugin %s (%s).",
sPluginName, oExp, exc_info=1)
continue
# find plugin class
try:
cPlugin = mPlugin.plugin
except AttributeError, oExp:
logging.warn("Plugin module %s appears not to contain a"
1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 Next