Observed since 20 Oct, 16:45 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A utility for logging events in Python projects
The a8logging function is a utility for logging events in Python projects. It provides a consistent and flexible way to log successes, errors, and other events, and supports multiple output options such as logging to a file or pushing the logs to Elasticsearch.
To install the log_event function, you will need to install the following dependencies:
pip install -r requirements.txt
To use the log_event function, you will need to import it into your Python code and call it with the appropriate arguments. Here is an example of how to log a success event:
from a8logging import a8logging
a8logging('success', "Test message", function_name='test_function', project_name='test_project', version='1.0.0')
This will log a success event with the message 'Test message', the function name 'test_function', the project name 'test_project', and the version '1.0.0'. To log an error event, you can pass the error argument with an Exception object:
from a8logging import a8logging
try:
# Some code that may throw an exception
raise Exception('Test error')
except Exception as e:
a8logging('error', "Test error", function_name='test_function', error=e, project_name='test_project', version='1.0.0')
This will log an error event with the message 'Test error', the function name 'test_function', the project name 'test_project', and the version '1.0.0'. The error traceback will also be logged.
To log to a file, you can pass the save_to_file argument with a value of True and the file_name argument with the desired file name:
from a8logging import a8logging
a8logging('success', "Test message", function_name='test_function', project_name='test_project', version='1.0.0', save_to_file=True, file_name='test.txt')
This will log the event to the file 'test.txt'.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 1.0.6 | 3 Jan 2023 | 2 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 16:45 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:b7ed2348f8d504b3c5fa4961f2e2406b7825eeca61da6822d8b1615ca1a2916a