GithubHelp home page GithubHelp logo

示例代码执行报错了,python 3.6 nb_log模块, AttributeError: 'Manager' object has no attribute '_clear_cache' about funboost HOT 7 CLOSED

lonevle avatar lonevle commented on May 23, 2024
示例代码执行报错了,python 3.6 nb_log模块, AttributeError: 'Manager' object has no attribute '_clear_cache'

from funboost.

Comments (7)

lonevle avatar lonevle commented on May 23, 2024

Python 3.6.8的logging模块中manager没有_clear_cache方法
['class', 'delattr', 'dict', 'dir', 'doc', 'eq', 'format', 'ge', 'getattribute', 'gt', 'hash', 'init', 'init_subclass', 'le', 'lt', 'module', 'ne', 'new', 'reduce', 'reduce_ex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', '_fixupChildren', '_fixupParents', 'disable', 'emittedNoHandlerWarning', 'getLogger', 'logRecordFactory', 'loggerClass', 'loggerDict', 'root', 'setLogRecordFactory', 'setLoggerClass']

from funboost.

lonevle avatar lonevle commented on May 23, 2024

然后拷贝了python3.9版本的logging, 用cmd和conda打开没有颜色

python3.6 + python3.9logging

image

python3.9 anaconda

image

from funboost.

ydf0509 avatar ydf0509 commented on May 23, 2024

win cmd一直是显示不了颜色的,需要用powershell,你是win7吗。为什么还在用cmd,现在都用powershell 香多了。
或者pycahrm中才能显示颜色

from funboost.

ydf0509 avatar ydf0509 commented on May 23, 2024

def revision_setLevel(self, level):
"""
Set the logging level of this logger. level must be an int or a str.
"""
level2 = LogManager.preset_name__level_map.get(self.name, level)
if level2 != level:
very_nb_print(f'日志命名空间 {self.name} 已经锁定了为了 {level2} 级别 ,后续不可以更改为 {level} 级别')
self.level = _checkLevel(level2)
self.manager._clear_cache()

上周新加的猴子补丁,没有使用python3.6测试过,nb_log包需要改一下兼容一下 python3.6

from funboost.

ydf0509 avatar ydf0509 commented on May 23, 2024

image
需要用win11的cmd或者 powershell日志才能显示彩色,win7的cmd是显示不了颜色的。或者你在pycahrm中运行

from funboost.

ydf0509 avatar ydf0509 commented on May 23, 2024

你升级到 funboost20.3,或者 pip install nb_log==8.2,解决3.6 logging包的 Manager没有 _clear_cache 方法的问题

from funboost.

lonevle avatar lonevle commented on May 23, 2024

感谢, 更新后已经正常了.

from funboost.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.