Simple logger writen in c++
Project description
PictLogger
A simple logger writen in c++ For now, works only on Linux, X86_64 I`m trying to compile it for Windows, maybe it will be
You can see all sources at https://github.com/ilyadudelzak/pictlogger
How to use
To save files you need to create the "logs" folder near your main program
Simple example:
import pictlogger
pictlogger.start(True)
pictlogger.log("Testing", "Hello, World!")
pictlogger.close(0)
It prints and saves to the file:
Fri Oct 13 15:34:48 2023 Pictlogger: Started
Fri Oct 13 15:34:48 2023 PictLogger: Version: 0.0.1
Fri Oct 13 15:34:48 2023 Python: PictLogger Imported Successfully
Fri Oct 13 15:34:48 2023 Testing: Hello, World!
Fri Oct 13 15:34:48 2023 PictLogger: Exit with exit code: 0 (Success)
Example with exception
import pictlogger
pictlogger.start(True)
pictlogger.log("Testing", "Hello, World!")
try:
n = int(input())
pictlogger.log("Testing", "User entered number " + str(n));
pictlogger.close(0)
except Exception as e:
pictlogger.log("Exception", str(e))
pictlogger.close(1)
it will print
Fri Oct 13 16:10:19 2023 Pictlogger: Started PictLogger
Fri Oct 13 16:10:19 2023 PictLogger: Version: 0.0.1
Fri Oct 13 16:10:19 2023 Python: PictLogger Imported Successfully
Fri Oct 13 16:10:19 2023 Testing: Hello, World!
1234
Fri Oct 13 16:10:21 2023 Testing: User entered number 1234
Fri Oct 13 16:10:21 2023 PictLogger: Exit with exit code: 0 (Success)
Or
Fri Oct 13 16:10:37 2023 Pictlogger: Started PictLogger
Fri Oct 13 16:10:37 2023 PictLogger: Version: 0.0.1
Fri Oct 13 16:10:37 2023 Python: PictLogger Imported Successfully
Fri Oct 13 16:10:37 2023 Testing: Hello, World!
kitten
Fri Oct 13 16:10:41 2023 Exception: invalid literal for int() with base 10: 'kitten'
Fri Oct 13 16:10:41 2023 PictLogger: Exit with exit code: 1 (Error)
Documentation
start(print)
Starts library, opens the file.
print is True or False
If it is true, library will print all logs to the screen.
If if is false, it will not print logs, but save all to the file, like before.
log(sender, text)
It will save log string to file and print it, if you setted print to true.
sender is string, thal prints before text. text is string, that prints after text, it contains main sense of the log.
close(code)
Closes output and saves files Call at end of program
code is number, that is an exit code of your program. Library will print it after exit message
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file PictLogger-0.1.3.tar.gz.
File metadata
- Download URL: PictLogger-0.1.3.tar.gz
- Upload date:
- Size: 13.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09fa709c061b1f132a7c7a8134efd45757d97c4aabb86f96b70f559a95d08c77
|
|
| MD5 |
4f265b6df0080d38c31f3412eb18d161
|
|
| BLAKE2b-256 |
3f341bb9c1a3272cf5966648c0aa350325cd102fcba8af6b82bc9fa618e9cd3c
|
File details
Details for the file PictLogger-0.1.3-py3-none-any.whl.
File metadata
- Download URL: PictLogger-0.1.3-py3-none-any.whl
- Upload date:
- Size: 12.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e36111ae5bd40301f7b217c2985cad50a765d1d245e42220f4c862be2f817aab
|
|
| MD5 |
dacee7392936ab3080b2491e845fbb60
|
|
| BLAKE2b-256 |
9ed13aa32b9a8d47646a005fd0085ef9f3d10c0ee42ee20784d8527ae00f509b
|