Skip to main content

A python logger module for the codeCTRL application

Project description

codeCTRL (python)

A python library for the codeCTRL logger.

The codectrl.log function collects and formats information about the file/function/line of code it got called on and sends it to the codeCTRL server, if available.

Installation

pip

pip install codectrl

Manual install (linux & MacOS)

Clone the repository:

git clone https://github.com/pwnCTRL/codectrl-python-logger.git
cd codectrl-python-logger

Build the package:

python3 setup.py build

Install the package. Depending on your python install this may require root privileges.

(sudo) python3 setup.py install

Usage

Make sure you have the codeCTRL application running.

Anywhere in a python codebase you can insert codectrl.log() to print logs to the codeCTRL app.

The function takes any number of arbitrary positional and keyword arguments.

All positional arguments get included in the log message using str() or json.dumps(obj, indent=4) in case of dicts.

Keyword arguments, other than "reserved" ones, get appended to the logs as {key}={value}

Reserved arguments:

  • host: By default set to 127.0.0.1, this argument holds the address of the codeCTRL server.

  • port: By default set to 3001, this is the port the codeCTRL server should be contacted at.

  • surround: By default 3, this argument specifies the number of lines of code that should be displayed around the call to codectrl.log.

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

codectrl-0.1.7.tar.gz (5.4 kB view details)

Uploaded Source

File details

Details for the file codectrl-0.1.7.tar.gz.

File metadata

  • Download URL: codectrl-0.1.7.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.8.1 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.2

File hashes

Hashes for codectrl-0.1.7.tar.gz
Algorithm Hash digest
SHA256 5bbbb66d494268559f12ab81f1a3319722795a4d6d76e0fbed5bf805d118629d
MD5 600796f2414738c1f59236e30d78a67e
BLAKE2b-256 97604ab4e954d521985c185a90d61797162716d32ff892e4b9dcf6714844e815

See more details on using hashes here.

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