Skip to content

Commit

Permalink
Update documentation and release notes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicoretti committed Mar 13, 2024
1 parent aac9db4 commit ccefdf3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
22 changes: 22 additions & 0 deletions doc/changes/unreleased.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
# Unreleased

## Added
- Added logging support
**Overview**

The bucketfs logger can be referenced via `exasol.bucketfs`

```python
import logging
# Get the logger for 'exasol.bucketfs'
logger = logging.getLogger('exasol.bucketfs')
```

For most use cases it should be sufficient to just configure the root logger, in order
to retrieve the logs from bucketfs.

```python
import logging

logging.basicConfig(level=logging.INFO)
```


## Internal
- Relock dependencies
- Update abatilo/actions-poetry from `v2.1.4` to `v3.0.0`
Expand Down
26 changes: 26 additions & 0 deletions doc/examples/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import logging
from exasol.bucketfs import Service

logging.basicConfig(level=logging.INFO)

# Advanced Logging
import logging
from exasol.bucketfs import Service

# Attention:
# It is essential to configure the root logger at the beginning of your script.
# This ensures that log messages, including those from the bucketfs are handled correctly.
# Without proper configuration, log messages might not appear as expected.
logging.basicConfig(level=logging.INFO)

# Explicityly Configure the bucketfs logger if you need to.
#
# 1. Get a reference to the bucketfs logger
bucketfs_logger = logging.getLogger('exasol.bucketfs')

# 2. Configure the bucketfs logger as needed
# Note:
# By default bucketfs logger is set to NOTSET (https://docs.python.org/3.11/library/logging.html#logging.NOTSET)
# which should be sufficient in lots of cases where the root logger is configured approriately.
bucketfs_logger.setLevel(logging.DEBUG)
...
7 changes: 7 additions & 0 deletions doc/user_guide/advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ Delete files from Bucket
:start-after: # Expert/Mapped bucket API


Configure logging
+++++++++++++++++

.. literalinclude:: /examples/logger.py
:language: python3
:start-after: # Advanced Logging

7 changes: 7 additions & 0 deletions doc/user_guide/basics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,10 @@ Delete files from Bucket
:end-before: # Expert/Mapped bucket API


Configure logging
+++++++++++++++++

.. literalinclude:: /examples/logger.py
:language: python3
:end-before: # Advanced Logging

0 comments on commit ccefdf3

Please sign in to comment.