bnmetrics / logme Goto Github PK
View Code? Open in Web Editor NEWPython Logging For Humans (Also supports configurable color logging for the terminal!)
License: Other
Python Logging For Humans (Also supports configurable color logging for the terminal!)
License: Other
Disclaimer: This is a bot
It looks like your repo is trending. The github_trending_videos Instgram account automatically shows the demo gifs of trending repos in Github.
Your README doesn't seem to have any demo gifs. Add one and the next time the parser runs it will pick it up and post it on its Instagram feed. If you don't want to just close this issue we won't bother you again.
Appreciated to make the logging function easier.
However, it seems not support to modify the datefmt
in logme.ini?
https://github.com/BNMetrics/logme/blob/master/logme/providers.py#L243-L248
Wish to implement the datefmt
in the future.
logger.Formatter(..., datefmt='%Y-%m-%d %H:%M:%S')
While inside a daemon python thread log me will output twice:
When attempting to use logme for a simple Python script without calling logme init
or having an ini
file, it appears that the configuration resolving code goes into an infinite recursion. Relevant part of stack below:
File "/Users/groodt/dev/data-science/.direnv/python-3.6.2/lib/python3.6/site-packages/logme/utils.py", line 117, in get_ini_file_path
return get_ini_file_path(Path(caller_file_path).parent)
File "/Users/groodt/dev/data-science/.direnv/python-3.6.2/lib/python3.6/site-packages/logme/utils.py", line 117, in get_ini_file_path
return get_ini_file_path(Path(caller_file_path).parent)
[Previous line repeated 978 more times]
File "/Users/groodt/dev/data-science/.direnv/python-3.6.2/lib/python3.6/site-packages/logme/utils.py", line 113, in get_ini_file_path
Path(caller_file_path).home().resolve()]:
File "/Users/groodt/.pyenv/versions/3.6.2/lib/python3.6/pathlib.py", line 1040, in home
return cls(cls()._flavour.gethomedir(None))
File "/Users/groodt/.pyenv/versions/3.6.2/lib/python3.6/pathlib.py", line 979, in __new__
self = cls._from_parts(args, init=False)
File "/Users/groodt/.pyenv/versions/3.6.2/lib/python3.6/pathlib.py", line 654, in _from_parts
drv, root, parts = self._parse_args(args)
File "/Users/groodt/.pyenv/versions/3.6.2/lib/python3.6/pathlib.py", line 647, in _parse_args
return cls._flavour.parse_parts(parts)
File "/Users/groodt/.pyenv/versions/3.6.2/lib/python3.6/pathlib.py", line 56, in parse_parts
it = reversed(parts)
RecursionError: maximum recursion depth exceeded while calling a Python object
Now, I'd love to help fix the problem. Is it as simple as the precondition on line 112 being incorrect?
if caller_file_path in [Path(Path(caller_file_path).root).resolve(),
Path(caller_file_path).home().resolve()]:
raise ValueError(f"logme.ini does not exist, please use 'logme init' command in your project root.")
Should this be checking if not conf_path in ...
?
sane defaults?
Useful for dependent packages.
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS
Release: 16.04
Codename: xenial
Requirement already up-to-date: logme in /usr/local/lib/python3.5/dist-packages (1.3.0)
Requirement already satisfied, skipping upgrade: bnmutils in /usr/local/lib/python3.5/dist-packages (from logme) (1.0.2)
Requirement already satisfied, skipping upgrade: click in /usr/local/lib/python3.5/dist-packages (from logme) (7.0)
Python 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
import logme
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.5/dist-packages/logme/init.py", line 53
raise MisMatchScope(f"{callable_} is a class, cannot be assigned to a '{scope}' scope")
^
SyntaxError: invalid syntax
I see its possible to use inside a function or class, but is it possible at
global level? other projects offer this:
from logzero import logger
logger.info('abcde')
logger.warning('abcde')
logger.error('abcde')
...
self.log.info('something')
might be nice. would need to keep self.logger
, though, for already-dependent libs.
I get this error "TypeError: 'PosixPath' object is not iterable"
The file logme.ini is added into the root folder of the project.
Here is the error trace:
File "/opt/app/pip/logme/__init__.py", line 34, in log
return _get_logger_decorator(scope, config=config, name=name)
File "/opt/app/pip/logme/__init__.py", line 63, in _get_logger_decorator
provider = LogProvider(callable_, config=config, name=name)
File "/opt/app/pip/logme/providers.py", line 40, in __init__
config_dict = get_logger_config(module_obj.__file__, name=config)
File "/opt/app/pip/logme/utils.py", line 67, in get_logger_config
return get_config_content(caller_file_path, name=name)
File "/opt/app/pip/logme/utils.py", line 94, in get_config_content
config = ConfigParser.from_files(init_file_path)
File "/opt/app/pip/bnmutils/configparser.py", line 29, in from_files
obj.read(filenames, encoding)
File "/opt/app/pip/backports/configparser/__init__.py", line 702, in read
for filename in filenames:
TypeError: 'PosixPath' object is not iterable
Dependabot couldn't authenticate with https://pypi.org/simple/.
You can provide authentication details in your Dependabot dashboard by clicking into the account menu (in the top right) and selecting 'Config variables'.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.