Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display 'use cache' when return result using cache #39

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

shiimaxx
Copy link

Currently, whether the plugin uses cache for return results is not contains in messages. (but, I can display it use -O option)

I included 'use cache' in a message when the plugin uses the cache, to avoid confusion.

@netmarkjp
Copy link
Contributor

@shiimaxx Thanks ;)
If we aim to avoid confusion, I think it's better that we should print the datetime the cache was made too.
How do you think?

@shiimaxx shiimaxx force-pushed the display-cache-use branch 2 times, most recently from 67d2f2e to ec1aa5e Compare February 3, 2020 04:59
@shiimaxx
Copy link
Author

shiimaxx commented Feb 3, 2020

@netmarkjp
I changed the message to contains the datetime of cache because I think it's better.

$ python check_log_ng.py -p 'ERROR' -S ./seek -l 'test.log' --cachetime=10
OK - No matches found. (use cache created at 2020-02-03T14:48:09.866695)

Current implementation uses the naive object that doesn't contain timezone information in datetime of cache.
This work on Python2 and Python3 with standard libraries only (but, trying to treat timezone in Python2 should third-party library like pytz).

@netmarkjp
Copy link
Contributor

@shiimaxx Thanks a lot ☺️

seek/y2Q55o5X_gupsGXqUEpn2VDgb9k=.cache is added but should we add this file?

@shiimaxx
Copy link
Author

shiimaxx commented Feb 3, 2020

@netmarkjp
Sorry, I pushed some local test files. Deleted those files and force pushed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants