Logging class/functions in Python

Python Code, by Xingpeng Li, Apr 03, 2023.
GitHub
Authors in the RPG Lab

Logpy

This is a set of Python codes that create a log file. It allows users to easily write log information with elapsed time and CPU clock time in the log file and it can be smoothly incorporated into users’ own codes. Each log information is numbered and ordered.

Users can simply copy either (i) the folder “logpy”, or (ii) the file “logpy.py” into the user’s current working directory. The log file will be automatically saved in the same working directory when an instance is created - by default.

By default, the log file will be automatically created when the class logpy is instantiated with a unique file name (launching time is part of the log file name).

Several examples are provided to show how to use the developed classes for logging purpose. Results for those three examples are also provided for users’ convenience.

Contact:

Dr. Xingpeng Li

University of Houston

Email: xli83@central.uh.edu

Website: https://rpglab.github.io/

License:

This work is licensed under the terms of the Creative Commons Attribution 4.0 (CC BY 4.0) license.

Disclaimer:

The author doesn’t make any warranty for the accuracy, completeness, or usefulness of any information disclosed; and the author assumes no liability or responsibility for any errors or omissions for the information (data/code/results etc) disclosed.