Overview
This is logger written from scratch. It offers few conveniences that helps in logging (e.g.: logging exceptions). It can also log some messages from ZPT (Zope Page Templates).
Using
stxnext.log can be opened by used in python code:
>>> from stxnext.log import log
>>> log('log <this> text')
>>> log('log another text', printit=True) #doctest:+ELLIPSIS
[...] log another text
>>> try:
... 1/0
... except ZeroDivisionError, e:
... log.log_exc(e)
...
>>> log.getLoggedTextAsHtml() #doctest:+ELLIPSIS, +NORMALIZE_WHITESPACE
<pre>[...] log <this> text...</pre>
stxnext.log can be also used in ZPT templates:
<tal:block tal:define="log context/@@STXNextLogger;
result python: log.setFilename('logger_filename.log');
result python: log.setName('logger name');">
<tal:block tal:define="result python: log('log this text')" />
<tal:block tal:define="result python: log('log another text', printit=True)" />
<pre tal:replace="structure log/getLoggedTextAsHtml" />
</tal:block>
Installation
Alternatively, if you are using zc.buildout to manage your project, you can do this:
Add stxnext.log to the list of eggs to install, e.g.:
[buildout] ... eggs = ... stxnext.logIf you’re using plone.recipe.zope2instance recipe to manage your instance add this lines to install a ZCML slug:
[instance] recipe = plone.recipe.zope2instance ... zcml = ... stxnext.logIf you’re using zc.zope3recipes:application recipe to manage your instance add this lines to install a ZCML slug:
[instance] recipe = zc.zope3recipes:application ... site.zcml = ... <include package="stxnext.log" />Re-run buildout, e.g. with:
$ ./bin/buildout
You can skip the ZCML slug if you are going to explicitly include the package from another package’s configure.zcml file.
References
Metadata
Release files for stxnext.log 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| stxnext.log-0.2.0.tar.gz | 6.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stxnext.log-0.2.0-py2.4.egg | Legacy Egg format | - | - | Details |
Total release size: 16.8 kB
Release files / stxnext.log-0.2.0.tar.gz
| Download URL | stxnext.log-0.2.0.tar.gz |
|---|---|
| Size | 6.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6fd4a53fc3190b9dd52ca351bb03924cb3f2f1df97a8324dbfe9f6744fc1d857
|
|
BLAKE2b-256 checksum How to use checksums |
5146b253ea92c7451ee771aedb3b452bc0a2499ebe9e4032ea777d2542ee9c61
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / stxnext.log-0.2.0-py2.4.egg
| Download URL | stxnext.log-0.2.0-py2.4.egg |
|---|---|
| Size | 10.6 kB |
| Tags | Egg |
|
SHA-256 checksum How to use checksums |
3d5cbeda6b766595c9809e5bf4103a4499bf2b4ef7a8d97a6766ecacabe0a6ab
|
|
BLAKE2b-256 checksum How to use checksums |
bd0a160039c7727b3c0fc055fa08d79946dce5aec23f2b677b8a8f68318bc3a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for stxnext.log 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.