Skip to main content

WSGI middleware for logging profiling data.

Project description

Provides profiling results through console.log. Home-page: https://github.com/chromano/profilelog Maintainer: Carlos H. Romano Maintainer-email: chromano@gmail.com License: UNKNOWN Description: # ProfileLogMiddleware

This is a WSGI middleware which will profile the request and embed it in the response. The default behavior is to embed the profiling data via console.table, right before the closing <html> tag. The result is that you can then see the information by opening devtools (should work on both Chrome and Firefox):

![](https://github.com/chromano/profilelog-middleware/blob/master/sample.png “Chrome devtools”)

## Installation

pip install profilelog-middleware

## Usage

Simply wrap your WSGI application with profilelog.middleware.ProfileLogMiddleware. Below is an example for the wsgi.py file provided with Django projects:

from django.core.wsgi import get_wsgi_application from profilelog.middleware import ProfileLogMiddleware

application = ProfileLogMiddleware(get_wsgi_application())

## Config

You can specify to the middleware how far you want to go by specifying the number of function calls to display. Example:

application = ProfileLogMiddleware(get_wsgi_application(), limit=5)

The default value for limit is 25, which should suffice for most usecases.

## Caveats

If you have a compression middleware in place (for example, a gzip middleware), make sure to disable it or run it after ProfileLogMiddleware, otherwise the default profile logging function won’t be able to identify the content.

Platform: UNKNOWN

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

profilelog-middleware-0.0.2.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

profilelog_middleware-0.0.2-py2.py3-none-any.whl (5.2 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file profilelog-middleware-0.0.2.tar.gz.

File metadata

File hashes

Hashes for profilelog-middleware-0.0.2.tar.gz
Algorithm Hash digest
SHA256 7b86515a303eb728000c212820a6fc486ef4e1129898b9af9e4847c0bcfb4c5b
MD5 01b2472327aec614e7b401f5548635bc
BLAKE2b-256 31fd98b987711a055eb4b8472e0642e8824bf2d99e1edfa311d4fc31366d0dac

See more details on using hashes here.

File details

Details for the file profilelog_middleware-0.0.2-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for profilelog_middleware-0.0.2-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 8e8a635dbea794e4da66d88b7b75c475fdc5d1e8389bfe761fb798bb3645ef03
MD5 0b6c621701a83ea4715a428d3f507f38
BLAKE2b-256 688f4961cae252b655853a7183bd4a1e76638477de9b4e85b45f1d1096771dee

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