Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ client = Client()
Please consult `CONTRIB.md`

## Testing
1. Update the `Makefile` with your `staging` or `prod` API key. Make sure the key is not from a free tier account.
1. Update the `Makefile` with your `staging` or `prod` API key. Ensure that docker has been installed on your system. Make sure the key is not from a free tier account.
2. To test on `staging`:
```
make test-staging
Expand Down
12 changes: 12 additions & 0 deletions labelbox/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ def __init__(self,
labelbox.exceptions.AuthenticationError: If no `api_key`
is provided as an argument or via the environment
variable.

Logging:
Logging is defaulted to level WARNING. To receive more verbose
output to console, update logging.level to the
appropriate level.

Example:
#get updated on console when client is instantiated
import logger

logging.basicConfig(level = logging.INFO)
client = Client("<APIKEY>")
"""
if api_key is None:
if _LABELBOX_API_KEY not in os.environ:
Expand Down
20 changes: 20 additions & 0 deletions tests/integration/test_logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
from labelbox import Client
import pytest
import logging


def test_client_log(caplog, project):
"""
This file tests that the logger will properly output to the console after updating logging level

The default level is set to WARNING

There is an expected output after setting logging level to DEBUG
"""

project.export_labels()
assert '' == caplog.text

with caplog.at_level(logging.DEBUG):
project.export_labels()
assert "label export, waiting for server..." in caplog.text