Skip to main content

PavLogger provides the ability to log debug and exception to a text file or a SQLite database with optional Backtrace output.

Project description

PavWeb2

PavLogger

This currently provides a easy to use sqlite and postgres database commands. If you install SQLCypher, the library can also handle the encryption of the database.

Installation

Run the following to install:

pip install pav_logger

Usage

Optional:
    log_name:
        Provides a way to specify another log file name:
        Default: debug and exception
    show_backtrace:
        Provides a way to specify to show the backtrace of an message
        Default:
            Debug: False
            Error: True
    log_severity:
        Provides a way to specify a number for the log for SQLite database
        Default:
            Debug: 0
            Error: 4
    line_divider:
        Provides a way to change the dividing line between messages.
        Default:
            '#'

import pav_logger

pav_logger = pav_logger.PavLogger()
pav_logger.log_path = "<Location Folder Path>"
pav_logger.debug('This is a debug message.')

try:
    raise ValueError('There is an error')
except Exception as error:
    pav_logger.error(error)

pav_logger.log_to_database = True
pav_logger.debug('This is a debug message.')

try:
    raise ValueError('There is an error')
except Exception as error:
    pav_logger.error(error)

Project details


Download files

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

Source Distribution

pav_logger-1.0.1.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pav_logger-1.0.1-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file pav_logger-1.0.1.tar.gz.

File metadata

  • Download URL: pav_logger-1.0.1.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

File hashes

Hashes for pav_logger-1.0.1.tar.gz
Algorithm Hash digest
SHA256 59660ee1febedb9bdb0abe8c25fa41049b7f29a20c5a429bf0f17c40346c4bec
MD5 48df66e1332e72d86985b7ff7f1e8bea
BLAKE2b-256 7982778668e519926346e4e47c588036fd893f5ff7f623d117d4a48e8fe1fd32

See more details on using hashes here.

File details

Details for the file pav_logger-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: pav_logger-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.4

File hashes

Hashes for pav_logger-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 856a4be1eedbb36514b4246e0e303194f9cf196b5c3e1f72544e9689d26811cb
MD5 8fc3329ee1351a13d482cbfb1099781b
BLAKE2b-256 0dab1bfdfad734dbcde79fabf3bab09f611e07608e1e2d6b51fbc41f3935d5b3

See more details on using hashes here.

Supported by

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