Code Monkey home page Code Monkey logo

Comments (8)

ironman5366 avatar ironman5366 commented on May 18, 2024

Mainly just because I REALLY like the look and style of my terminal logging. I'm fairly ignorant of the python builtin logging (having always used my own), could it be formatted with utilities like termcolor like mine is? And I also have two settings in mine that determine whether you want to keep logs or delete the old ones and whether you want to see terminal output or just a log file written. If this stuff can be replicated the sure, go for it.

from w.i.l.l.

brenttaylor avatar brenttaylor commented on May 18, 2024

Everything but the color can be replicated. That said, the built in logging is a lot more robust and fault tolerant and we should really be using it. Generally speaking, if it's in the standard library you want to use it rather than rolling your own unless you have a very good reason to do otherwise.

I'll get started refactoring the logging code today.

from w.i.l.l.

ironman5366 avatar ironman5366 commented on May 18, 2024

Yeah sure I guess. I am pretty partial to my terminal logging though, it's been a part of W.I.L.L for awhile. If you wouldn't mind going out of your way, can you get the log entry from the good builtin logging module and pass it through with termcolor like I've been doing?

from w.i.l.l.

brenttaylor avatar brenttaylor commented on May 18, 2024

I'll look into it. That said, I'm personally partial to removing termcolor all together. It doesn't play well with everything, especially on windows. It's all sorts of odd in PowerShell, for example.

from w.i.l.l.

ironman5366 avatar ironman5366 commented on May 18, 2024

Fair enough. I appreciate you working on it, thanks.

from w.i.l.l.

ironman5366 avatar ironman5366 commented on May 18, 2024

Ok. So I merged in the code and I can't seem to fix the following error:
Traceback (most recent call last): File "main.py", line 15, in <module> from logger import log File "/home/will/Code/W.I.L.L/logger.py", line 88, in <module> _setup_logger() File "/home/will/Code/W.I.L.L/logger.py", line 45, in _setup_logger log.setLevel(_get_logging_level()) File "/home/will/Code/W.I.L.L/logger.py", line 63, in _get_logging_level return logging.DEBUG if will_config["debug"] else logging.ERROR KeyError: 'debug'
I looked through the code and I'm not completely sure what's happening here. My config.json is set up

from w.i.l.l.

ironman5366 avatar ironman5366 commented on May 18, 2024

My mistake, I hadn't made the necessary changes to config.json. Closing

from w.i.l.l.

brenttaylor avatar brenttaylor commented on May 18, 2024

That really should be considered a bug. I'll write up a new issue.

from w.i.l.l.

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.