本文整理汇总了Python中pi3d.util.Log.logger方法的典型用法代码示例。如果您正苦于以下问题:Python Log.logger方法的具体用法?Python Log.logger怎么用?Python Log.logger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pi3d.util.Log
的用法示例。
在下文中一共展示了Log.logger方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _load_library
# 需要导入模块: from pi3d.util import Log [as 别名]
# 或者: from pi3d.util.Log import logger [as 别名]
def _load_library(name, version=""):
"""Try to load a shared library, report an error on failure."""
try:
import ctypes
return ctypes.CDLL("lib{}.so{}".format(name, version))
except:
from pi3d.util import Log
Log.logger(__name__).error("Couldn't load library lib%s.so%s", name, version)
示例2: _load_library
# 需要导入模块: from pi3d.util import Log [as 别名]
# 或者: from pi3d.util.Log import logger [as 别名]
def _load_library(name):
"""Try to load a shared library, report an error on failure."""
if name:
try:
import ctypes
return ctypes.CDLL(name)
except:
from pi3d.util import Log
Log.logger(__name__).error("Couldn't load library %s", name)
示例3: _load_library
# 需要导入模块: from pi3d.util import Log [as 别名]
# 或者: from pi3d.util.Log import logger [as 别名]
def _load_library(name, dll_type="C"):
"""Try to load a shared library, report an error on failure."""
if name:
try:
if dll_type == "Win":
return ctypes.WinDLL(name)
else:
return ctypes.CDLL(name)
except:
from pi3d.util import Log
Log.logger(__name__).error("Couldn't load library %s", name)
示例4: _Mouse
# 需要导入模块: from pi3d.util import Log [as 别名]
# 或者: from pi3d.util.Log import logger [as 别名]
from __future__ import absolute_import, division, print_function, unicode_literals
import threading
import six
from pi3d.util import Log
LOGGER = Log.logger(__name__)
class _Mouse(threading.Thread):
"""holds Mouse object, see also (the preferred) events methods"""
BUTTON_1 = 1 << 1
BUTTON_2 = 1 << 2
BUTTONS = BUTTON_1 & BUTTON_2
HEADER = 1 << 3
XSIGN = 1 << 4
YSIGN = 1 << 5
INSTANCE = None
def __init__(self, mouse='mice', restrict=True, width=1920, height=1200):
"""
Arguments:
*mouse*
/dev/input/ device name
*restrict*
stops or allows the mouse x and y values to carry on going beyond:
*width*
mouse x limit
*height*
mouse y limit
"""