diff --git a/README.md b/README.md index 4f2cf6801..83d376660 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/labelbox/client.py b/labelbox/client.py index d81ad22b4..02d11669f 100644 --- a/labelbox/client.py +++ b/labelbox/client.py @@ -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("") """ if api_key is None: if _LABELBOX_API_KEY not in os.environ: diff --git a/tests/integration/test_logger.py b/tests/integration/test_logger.py new file mode 100644 index 000000000..c8b9dcf8b --- /dev/null +++ b/tests/integration/test_logger.py @@ -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