robocorp-log
robocorp-log is a library which provides comprehensible logging for Python with a focus on Python automation, where detailed information on what happened and why a failure occurs is of vital importance.
Note: The format of the log is not a part of the API and should not be relied upon as it can change even between minor versions.
Why
Although Python logging is flexible it may be hard to analyze the logging afterwards and visualize it. Also, the format may end up using a big amount of disk space and it may be tedious to add logging calls to all places of interest.
How
robocorp-log improves those aspects by using a structured format which enables using less disk space while also providing a viewer (log.html) for the generated content.
Also, it provides utilities to setup logging so that logging is done automatically without having to explicitly add calls to add content to the logging (although it's still possible to do so when needed).
Usage
It's recommended that robocorp-log is used through robocorp-tasks as robocorp-tasks will configure robocorp-log in a streamlined way, where you just need to worry about marking the entry point method with a @tasks decorator and it'll automatically setup the auto-logging and provide the log result in output/log.html.
Configuring with pyproject.toml
robocorp-tasks takes care of customizing robocorp-log through pyproject.toml.
See the robocorp-tasks project for more information (robocorp-log only provides the core logging structure and different libraries may customize it in different ways).
Although the setup is done through robocorp-tasks, there are still some APIs in robocorp.log which are interesting to use such as:
-
Utility methods to add a log message as
critical,warn,info,debug,exception -
Utility method to add an
htmlmessage (using thehtmlmethod). Note that thehtmlmethod is tested for images with base64 contents in thelog.html, other structures must be manually checked as they can break the layout. Also, keep in mind that the provided html will be sanitized. -
Supressing logging through
suppress_variables,suppress_methods,suppress. -
Hiding sensitive data (automatically based on variable or argument names with names registered in
add_sensitive_variable_nameandadd_sensitive_variable_name_pattern) or by passing the value to be hidden tohide_from_output.
Caveats
The auto import mode is done by having a pre-import hook which will change the AST at runtime. This mostly works, but there are a couple of caveats to keep in mind:
-
Debuggers may end up stepping into the
robocorp-logcode in many places even if such code isn't in the source code (you may want to configure the debugger you're using to skip calls intorobocorp.logas that's usually just an implementation detail). -
The logging needs to be fully setup prior to importing any module that should be automatically logged.
-
Working with coroutines (
async,awaitandgreenlet) is not supported.
Guides
API Reference
Explore our API for extensive documentation.
Changelog
A list of releases and corresponding changes can be found in the changelog.
Release files for robocorp-log 3.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| robocorp_log-3.1.4.tar.gz | 352.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| robocorp_log-3.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 714.2 kB
Release files / robocorp_log-3.1.4.tar.gz
| Download URL | robocorp_log-3.1.4.tar.gz |
|---|---|
| Size | 352.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9f1b4581c6d23a3ad05af7c969ca674dfcb53b3aaa75b7881054dcfad55304b
|
|
BLAKE2b-256 checksum How to use checksums |
aa2e42b72d333c7849e3d4ac086c6f3998722960ee58f1000b94c16b93ff1fde
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency logRelease files / robocorp_log-3.1.4-py3-none-any.whl
| Download URL | robocorp_log-3.1.4-py3-none-any.whl |
|---|---|
| Size | 362.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7240dd82b94516b866c41d3207cf6d3985eca1ea80945f9f36c2e4c59e989710
|
|
BLAKE2b-256 checksum How to use checksums |
70e0188b25d4693d51dd98126227f20c0de863e4b4dc53b093d1fda594d5fff2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 1, 2026.
Transparency log