Miksus / rocketry

Modern scheduling library for Python
https://rocketry.readthedocs.io
MIT License
3.26k stars 105 forks source link

Fix: Typo in docs/handbooks/logging.srt #72

Closed carlosm27 closed 2 years ago

carlosm27 commented 2 years ago

Fix typo mentioned in the issue #66

Miksus commented 2 years ago

Thanks for fixing this hard-to-spot typo!

Mind you changing the logging to logger on those lines as well? The docs incorrectly suggest adding the handler to the root logger instead of the logger that was just created.

carlosm27 commented 2 years ago

Oh yes, no problem. I think it is just in the "log to CSV file" example right?

Log to CSV file example:

... 
# Adding the repo to the logger

logger = logging.getLogger('rocketry.task')

handler = RepoHandler(repo=repo)

logging.addHander(handler)

In the "log the records to SQL database" example there is no logger created:

...
engine = create_engine("sqlite:///app.db")
repo = SQLRepo(engine=engine, table="tasks", if_missing="create", model=MinimalRecord, id_field="created")

handler = RepoHandler(repo=repo)
logging.addHander(handler)
Miksus commented 2 years ago

Thanks! Ye, meant that one.

It seems the other is slightly incorrect as well (should specify the logger the same way and use that instead of root logger) but I'll merge this one. Thanks again for spending the time to fix this!