Skip to content

fruafr/python-fruafr-log

Repository files navigation

Project generated with PyScaffold ReadTheDocs PyPI-Server Code Climate

python-fruafr-log

The fruafr.log package contains basic Python 3 logging utilities (CLI)

It provides :

It also provides :

How to install

To use the CLI:

pip install fruafr.log

To use the tiny syslog server, you will need to install the package with sudo permissions:

sudo pip install fruafr.log

How to use

Invoke the help command of each CLI with the -h or --help option.

e.g. logtofile.py --help

Implementation details

Target

  • The code has been tested on a standalone Ubuntu 22.04 LTS machine and in an Ubuntu WSL2 virtual machine.
  • Python 3 only (Tested on Python 3.10).

Requirements

  • Requires the Python standard library and YAML.

CLI - Good to know

  • The documentation of the CLI is available with the -h or -help flags.
  • It accepts the standard LogRecord attributes.
  • It accepts the logging levels of the standard library
  • It accept the default templating style of the logging library with the --format option: %(asctime)s
  • It provides standard and some non-standard options with the --options option to meet regular logging use cases: app, user, host, ip, interface, clientlevel, service. You have to provide the values with option flags to the CLI. These records will be added to the log message in the order specified with --options (e.g. ip,message). You can provide a custom separator for this message section with the --optsep option.

Tiny SysLog Server

  • Should only be used for testing purposes.
  • It was developed to test logtosyslog.py.
  • The server can listen on a single port to both UDP (--udp flag) and TCP (--tcp flag) sockets. It uses two processes (one for UDP and one for TCP).

Tests

Unit tests are available for all modules. It uses the Python unittest suite.

In addition, the UDP/TCP syslog client/server integration has been tested with an integration test found in tests/integration/fruafr_log_syslog_client_server.py.

Bugs reporting

Github Issues' page of the repository

License

  • MIT licensed.
  • In short : You are free to incorporate the library and/or its CLI in your open-source or proprietary projects.
  • Do whatever you want with this library as long as you include the license notice and the copyright in the copies.

Author

David HEURTEVENT

Note

This project has been set up using PyScaffold 4.4. For details and usage information on PyScaffold see https://pyscaffold.org/.

About

Python fruafr.log - Basic logging utilities (CLI) + Tiny Syslog server

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published