Skip to main content

A library for simple logging

Project description

Fibertrace


Fibertrace is a Python package that provides a logging utility for capturing and managing log entries in your applications. It offers a simple and customizable way to log messages with different log levels, timestamps, application names, modules, and user information.

ko-fi

Installation

To use Fibertrace, make sure you have Python installed on your system. You can install the package using pip:

pip install fibertrace

Usage

To get started with Fibertrace, you need to create a logger instance by calling the Logger class constructor. The constructor requires the log file path, application name, and a flag indicating whether to use JSON format for log entries.

from fibertrace import Logger

log_file_path = "log.txt"
application = "MyApp"
json_format = False

logger = Logger(log_file_path, application, json_format)

Once you have created the logger, you can use it to log messages with different log levels such as info, error, and debug. For example:

logger.info("This is an information message.")
logger.error("This is an error message.")
logger.debug("This is a debug message.")

The log messages will be written to the specified log file, along with the corresponding log level, timestamp, application name, module, and user information. Additionally, the log messages will be printed to the console.

Conclusion

Fibertrace simplifies logging in Python applications by providing a flexible and configurable logging utility. It helps you capture and manage log entries with ease, allowing you to track the execution flow, debug issues, and monitor your application's behavior. Feel free to explore the package further and adapt it to your specific logging needs. For more information and detailed examples, please refer to the package documentation and source code.

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

fibertrace-0.1.5.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

fibertrace-0.1.5-py3-none-any.whl (3.5 kB view hashes)

Uploaded Python 3

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