Skip to main content

A simple python logging library.

Project description

Glisten

Simple python logging library - because I write this code in every project.

Usage

import glisten

log = glisten.log.Logger('.log')

log.warn('A warning message')

produces:

>>> A warning message.

You can set verbose to False to suppress terminal messages (though it will always log to disk):

import glisten

log = glisten.log.Logger('.log', verbose=False)

log.warn('Terminal can\'t see this')```

will produce no terminal output, but `.log` will contain `[Warning] Terminal can't see this`.

Newlines get nicely formatted:

import glisten

log = glisten.log.Logger('.log')

log.warn("""This is a long message. It spans multiple lines. I like pizza.""")


produces:

[Warning] This is a long message. | It spans multiple lines. | I like pizza.


## Log types

- warn
- error
- deprecation

## Deprecations

`glisten` also provides a deprecation wrapper. One can use it as follows:

import glisten log = glisten.log.Logger('.log')

@log.deprecate def my_deprecated_function(): return


Any time this function is called, glisten will output `Function "my_deprecated_function" is deprecated.`, and log it to file.

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

glisten-1.0.2.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

glisten-1.0.2-py3-none-any.whl (4.1 kB view details)

Uploaded Python 3

File details

Details for the file glisten-1.0.2.tar.gz.

File metadata

  • Download URL: glisten-1.0.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for glisten-1.0.2.tar.gz
Algorithm Hash digest
SHA256 a426132a3f3aae7e5185922eabc7dd3b340efda85879716475145894f8ce2720
MD5 b1cff07b5cf000bc0ac8d882b62f9038
BLAKE2b-256 2e556ff0a614c0ac56fac3dacac2afe04896d83130c092344c01ff199bab0277

See more details on using hashes here.

File details

Details for the file glisten-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: glisten-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.8

File hashes

Hashes for glisten-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b66373c23848e9ab5782444161b7f99546abef2155c1c05678a5a16bd4149b6
MD5 2b974a55c1e0e84463b8485357ca0f07
BLAKE2b-256 158da4c5d18bc867a6daacda7e2ed167d25f34ca51555e90708bf2b252a74caf

See more details on using hashes here.

Supported by

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