Metadata-Version: 2.1
Name: dkist-service-configuration
Version: 1.1.0
Summary: Configuration support for DKIST services
Home-page: https://bitbucket.org/dkistdc/dkist_service_configuration/src/master/
Author: NSO / AURA
Author-email: "dkistdc@nso.edu"
License: MIT
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Requires-Python: >=3.10
License-File: LICENSE
Requires-Dist: loguru
Requires-Dist: pydantic[dotenv]<2.0
Provides-Extra: test
Requires-Dist: pytest; extra == "test"
Requires-Dist: pytest-cov; extra == "test"

dkist-service-configuration
===========================

A configuration for the `loguru <https://github.com/Delgan/loguru>`_ logger and base configuration object using `pydantic <https://docs.pydantic.dev/1.10/usage/settings/>`_ base settings.

It is important that it be the first import to run so the standard logging basicConfig method has an effect.

Features
--------

* Stderr output
* Intercepted logging from client libraries
* Disabled better exceptions for log levels above debug to mitigate secret leaking
* Configuration logging with secrets redacted
* DKIST Mesh Service configuration parsing

Installation
------------

.. code:: bash

   pip install dkist-service-configuration


Examples
--------

**config.py**

.. code:: python

    from dkist_service_configuration import logger
    from dkist_service_configuration import MeshServiceConfigurationBase
    logger.debug('hello world)
    class NewConfiguration(MeshServiceConfigurationBase):
        username: str = "me"
        password: str = "pass"
    new_configuration = NewConfiguration()
    new_configuration.log_configurations()

The code above will register the existing loggers, retrieve mesh configuration
and custom configuration from the environment and log it while redacting the
password.
