Skip to main content

Shared code logic in the project Thoth.

Project description

A library used in project Thoth. It’s aim is to provide core utilities for logger setup, manipulation with datetimes and similar handy helpers.

Installation

This project is released on PyPI, so the latest release can be installed via pip or Pipenv as shown below:

pipenv install thoth-common

This library will automatically discover installed packages and enable Sentry integrations if you use Flask, SQLAlchemy or AIOHTTP. An exception is for Flask applications, that need to explicitly install sentry-sdk[flask] due to integrations dependencies.

Logging setup

To setup a logger in any of Thoth’s component (component that are namespaced with thoth), you can simply set an environment variable. The name of environment variable is constructed from module name. Let’s say you want to debug thoth.adviser.pipeline module, in that case you can set environment variable:

THOTH_LOG_ADVISER_PIPELINE=DEBUG which will cause loggers thoth.adviser.pipeline to be set to DEBUG mode. See log-levels documentation for more info. If a module has underscore in its name, replace it with double underscore in the environment variable name.

Ignoring reports from a logger

In some cases it’s expected to turn off reporting of some logger to Sentry. You can provide THOTH_SENTRY_IGNORE_LOGGER environment variable which holds a comma separated list of loggers that should be ignored when reporting errors to Sentry:

THOTH_SENTRY_IGNORE_LOGGER="thoth.adviser.resolver,thoth.adviser.run"

This is helpful if you want to report errors to users but not to Thoth application itself.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

thoth-common-0.9.20.tar.gz (24.3 kB view details)

Uploaded Source

Built Distribution

thoth_common-0.9.20-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file thoth-common-0.9.20.tar.gz.

File metadata

  • Download URL: thoth-common-0.9.20.tar.gz
  • Upload date:
  • Size: 24.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/36.5.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

File hashes

Hashes for thoth-common-0.9.20.tar.gz
Algorithm Hash digest
SHA256 76b8e90977e4a0dde0fe06664e744dd4b1bf76c129cc3f51f001096bfef4160d
MD5 d4bcb43bd89d7cd7799baf809c80957d
BLAKE2b-256 2e0106155a820e388d44d4b20a912d819b337d586a33e28ead1b5fa29a73863d

See more details on using hashes here.

File details

Details for the file thoth_common-0.9.20-py3-none-any.whl.

File metadata

  • Download URL: thoth_common-0.9.20-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/36.5.0 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.3

File hashes

Hashes for thoth_common-0.9.20-py3-none-any.whl
Algorithm Hash digest
SHA256 358042e590fc0a6f64e44df3bd991a43faf5a91a48e6d34b788ac5dcd695ae1a
MD5 5e97ef7e3bf911d603e071143b07ae17
BLAKE2b-256 67244d2a4ddcd8697643f5b2deb0d8cc94530fb9f2c37e9ff50175226f781d98

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page