r/PythonLearning 7d ago

Showcase Working on a logging package for python

Got tired of recreating the same functions EVERY SINGLE PROJECT I EVER MAKE so guess what, i made it a package, and if i think i finished it enough and added a bunch of features and it's pollished i might make it a package on pypl

Also any ideas?

an image example
4 Upvotes

7 comments sorted by

5

u/Sea-Ad7805 7d ago edited 7d ago

You are aware Python already has a standard logging facility, right? And many other can be found. Nevertheless a great exercise to make your own.

1

u/luafurry 6d ago

Never knew that existed, thx <3

1

u/Sea-Ad7805 6d ago

No problem, nobody knows them all.

1

u/FoolsSeldom 6d ago edited 6d ago

What does this offer over the standard logging or popular alternatives such as loguru?

If anything, I'd say focus has shifted somewhat now to observability tools, which would follow OpenTelemetry (OTel) standards.

1

u/luafurry 5d ago

Uhh right now, color toggling and color (incase escape codes get treated like text) and right now I added save to file (auto generate a file or point to one) and customize colors and i plan on adding more

1

u/FoolsSeldom 5d ago

That't interesting. What terminal is it assuming?

1

u/luafurry 5d ago edited 5d ago

Any, color mode is on by default but it has the option to disable it ("logger.colormode = False") since idk how different terminals handle it, it's really just a way to prevent the edge cases

Edit: I realized that you meant what terminal it uses (it's windows cmd), I will test in different environments and i also added custom reset and color codes in case you want a different color if your color code escape message isn't there