-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
BUG set_repo doesn't work, though it is mentioned in the documentation #108
Comments
Thanks for reporting this! Indeed, it seems the method was forgotten to be implemented. Cannot remember what I though when I wrote that piece of docs. Rocketry simply extends the logging library and basically you just need a import logging
from redbird.repos import CSVFileRepo
from rocketry.log import LogRecord
from redbird.logging import RepoHandler
repo = CSVFileRepo(model=LogRecord, filename="tasks.csv")
repo.create()
task_logger = logging.getLogger("rocketry.task")
task_logger.handlers.insert(0, RepoHandler(repo=repo)) Put this somewhere before starting the app. Note that I used insert to make sure this is the first RepoHandler as the first repo handler is used for read and write from task logs. You can add other handlers as well as you wish. I'll revisit this on the weekend. |
Thank you for your help and quick reply. I just tried it out and it works! |
Ye, it seems I meant to merge this to master before creating the latest version: #88 It seems I forgot (and still have some timezone issues with the new tests (my time zone is different than CI's)). It seems I changed them in the docs before doing this. So I'll fix the PR soon and merge it and then this issue should be fixed as well. |
Doing the same for |
Describe the bug
I was going through the documentation here: https://rocketry.readthedocs.io/en/stable/cookbook/robust_applications.html?highlight=email#to-csv , and following the steps to add a repo to an app session, I get the error:
To Reproduce
This simple scripts will produce the error:
Expected behavior
The repo is set without any errors
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
Additional context
What else can I do to set the repo in the meantime?
The text was updated successfully, but these errors were encountered: