當前位置: 首頁>>代碼示例>>Python>>正文


Python logger.LOG_LEVELS類代碼示例

本文整理匯總了Python中kivy.logger.LOG_LEVELS的典型用法代碼示例。如果您正苦於以下問題:Python LOG_LEVELS類的具體用法?Python LOG_LEVELS怎麽用?Python LOG_LEVELS使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了LOG_LEVELS類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: logger_config_update

def logger_config_update(section, key, value):
    '''Callback called when the :attr:`~moa.config.Config` object changes the
    `log_level` key value.
    '''
    if LOG_LEVELS.get(value) is None:
        raise AttributeError('Loglevel {0!r} doesn\'t exists'.format(value))
    Logger.setLevel(level=LOG_LEVELS.get(value))
開發者ID:matham,項目名稱:moa,代碼行數:7,代碼來源:logger.py

示例2: module

            Activate a module (use "list" to get a list of available modules).
        -r, --rotation
            Rotate the window's contents (0, 90, 180, 270).
        -s, --save
            Save current Kivy configuration.
        --size=640x480
            Size of window geometry.
        --dpi=96
            Manually overload the Window DPI (for testing only.)
    '''
    print(kivy_usage.__doc__ % (basename(sys.argv[0])))


# Start !
if 'vim' in globals():
    Logger.setLevel(level=LOG_LEVELS.get('critical'))
else:
    Logger.setLevel(level=LOG_LEVELS.get('info'))
    Logger.info('Kivy v%s' % (__version__))

#: Global settings options for kivy
kivy_options = {
    'window': ('egl_rpi', 'pygame', 'sdl', 'x11'),
    'text': ('pil', 'pygame', 'sdlttf'),
    'video': ('gstplayer', 'ffmpeg', 'gi', 'pygst', 'pyglet', 'null'),
    'audio': ('gstplayer', 'pygame', 'gi', 'pygst', 'sdl'),
    'image': ('tex', 'imageio', 'dds', 'gif', 'pil', 'pygame'),
    'camera': ('opencv', 'gi', 'pygst', 'videocapture', 'avfoundation'),
    'spelling': ('enchant', 'osxappkit', ),
    'clipboard': ('android', 'pygame', 'dummy'), }
開發者ID:RaulSierro,項目名稱:Orkiv,代碼行數:30,代碼來源:__init__.py

示例3: mkdir

            mkdir(kivy_home_dir)
        if not exists(kivy_usermodules_dir):
            mkdir(kivy_usermodules_dir)
        if not exists(kivy_userexts_dir):
            mkdir(kivy_userexts_dir)
        if not exists(icon_dir):
            try:
                shutil.copytree(join(kivy_data_dir, 'logo'), icon_dir)
            except:
                Logger.exception('Error when copying logo directory')

    # configuration
    from kivy.config import Config

    # Set level of logger
    level = LOG_LEVELS.get(Config.get('kivy', 'log_level'))
    Logger.setLevel(level=level)

    # Can be overrided in command line
    if 'KIVY_UNITTEST' not in environ and 'KIVY_PACKAGING' not in environ:
        # save sys argv, otherwize, gstreamer use it and display help..
        sys_argv = sys.argv
        sys.argv = sys.argv[:1]

        try:
            opts, args = getopt(sys_argv[1:], 'hp:fkawFem:sr:dc:', [
                'help', 'fullscreen', 'windowed', 'fps', 'event',
                'module=', 'save', 'fake-fullscreen', 'auto-fullscreen',
                'display=', 'size=', 'rotate=', 'config=', 'debug',
                'dpi='])
開發者ID:krishardy,項目名稱:kivy,代碼行數:30,代碼來源:__init__.py

示例4: module

            Activate a module (use "list" to get a list of available modules).
        -r, --rotation
            Rotate the window's contents (0, 90, 180, 270).
        -s, --save
            Save current Kivy configuration.
        --size=640x480
            Size of window geometry.
        --dpi=96
            Manually overload the Window DPI (for testing only.)
    """
    print(kivy_usage.__doc__ % (basename(sys.argv[0])))


# Start !
if "vim" in globals():
    Logger.setLevel(level=LOG_LEVELS.get("critical"))
else:
    Logger.setLevel(level=LOG_LEVELS.get("info"))
    Logger.info("Kivy v%s" % (__version__))

#: Global settings options for kivy
kivy_options = {
    "window": ("egl_rpi", "pygame", "sdl", "x11"),
    "text": ("pil", "pygame", "sdlttf"),
    "video": ("ffmpeg", "gstreamer", "pyglet", "null"),
    "audio": ("pygame", "gstreamer", "sdl"),
    "image": ("tex", "imageio", "dds", "gif", "pil", "pygame"),
    "camera": ("opencv", "gstreamer", "videocapture"),
    "spelling": ("enchant", "osxappkit"),
    "clipboard": ("pygame", "dummy"),
}
開發者ID:geojeff,項目名稱:kivy,代碼行數:31,代碼來源:__init__.py


注:本文中的kivy.logger.LOG_LEVELS類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。