This is the ULTIMATE PROGRAM LOGS CREATOR made by ORWTMC Inc.
The world's most friendly logs made by program(yet)!
[21:5:44] [INFO] Program is running...
[21:6:5] [WARNING] User doesn't provided the value, using default!
[21:6:24] [FATAL] User terminated this program, shutting down...
[21:6:43] [INFO] System shutted down.
It's pretty simple, just add a line in your program
import uplcNever change 'uplc' to something else.
Now I'll give you a sample.
import uplc
logs = uplc.LogsCreator() # Default name is DefaultLog, the extension is ".ulog", you can't change it. You can add a string inside of it. e.g. logs = uplc.LogsCreator("MyAwesomeLogs")
logs.write("Program is running normally.", "info", 3)
# The result is: [xx:xx:xx] [INFO] Program is running normally.
logs.close() # VERY IMPORTANT!!! OTHERWISE THE LOG WILL NOT BE SAVED!!!- You have to import it and define a variable(e.g. logs), point to
LogsCreatorclass.
2. You can use `logs.write` to create a row.
logs.write(LOGS_TEXT, TYPE(DEBUG/INFO/WARNING/FATAL), TIME_ACCURACY)Time Accuracy:
0: YYYYMMDDHHMMSS
1: MMDDHHMMSS
2: DDHHMMSS
3: HHMMSS
Do not forget to use logs.close() to close the file, otherwise you will lose everything you created.