Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cartorio

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cartorio

Cartorio: A library for logging

  • 3.0.0
  • PyPI
  • Socket score

Maintainers
1

DOI Documentation Status GitHub tag (latest SemVer) LICENSE

1. Cartorio

A wrapper on the logging module for Python that provides a simple and easy-to-use interface for logging.

2. Contents

3. Installation

pip install cartorio

4. Documentation

https://cartorio.readthedocs.io/en/stable/

5. Usage

Consider that your project consists of two scripts:

parent.py
child/
└──  child.py

An example of these scripts are:

# parent.py

from pathlib import Path
from cartorio import make_logger, log

from child.child import multiply

@log
def main()
    multiply(10, 1)

if __name__ == "__main__":
    # Instantiation of log file
    logger, _ = make_logger(filename=Path(__file__).resolve().stem, logs_path=Path(__file__).resolve().parent)
    # where,
    # filename (str, Path): Log file.
    # logs_path (Path): Path where the log file is saved to.
    main()
# child.py

from cartorio import fun, log

@log
def multiply(num1, num2):
    return num1 * num2

The log filename will be parent_<timestamp>.log and it will contain the information in the form

<timestamp> || root || 30664 || INFO || parent.py || parent || <line_number> || Enter || multiply
<timestamp> || root || 30664 || INFO || parent.py || parent || <line_number> || Leave || multiply || Elapsed: 0:00:00.001708

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc