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

Changed logger name from "filelock._api" to "filelock" #97

Merged
merged 6 commits into from
Oct 2, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@ with lock:
```


### Adjusting the Log Level

By default, the logger name is *"filelock"* and the logging level is set to
*logging.WARNING*. This can be adjusted using the *logging* module.
hkennyv marked this conversation as resolved.
Show resolved Hide resolved

```Python
import logging

logging.getLogger("filelock").setLevel(logging.ERROR)
```


## FileLock vs SoftFileLock

The *FileLock* is platform dependent while the *SoftFileLock* is not. Use the
Expand Down
2 changes: 1 addition & 1 deletion src/filelock/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from ._error import Timeout

_LOGGER = logging.getLogger(__name__)
_LOGGER = logging.getLogger("filelock")
gaborbernat marked this conversation as resolved.
Show resolved Hide resolved


# This is a helper class which is returned by :meth:`BaseFileLock.acquire` and wraps the lock to make sure __enter__
Expand Down
1 change: 1 addition & 0 deletions tests/test_filelock.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def test_simple(lock_type, tmp_path, caplog):
"Lock {} released on {}".format(id(lock), lock_path),
]
assert [r.levelno for r in caplog.records] == [logging.DEBUG, logging.DEBUG, logging.DEBUG, logging.DEBUG]
assert [r.name for r in caplog.records] == ["filelock", "filelock", "filelock", "filelock"]


@contextmanager
Expand Down