https://github.com/britzl/printlogger
print() to stdout and log files
https://github.com/britzl/printlogger
lua
Last synced: 8 months ago
JSON representation
print() to stdout and log files
- Host: GitHub
- URL: https://github.com/britzl/printlogger
- Owner: britzl
- License: apache-2.0
- Created: 2014-06-25T20:07:59.000Z (about 12 years ago)
- Default Branch: master
- Last Pushed: 2014-08-29T11:18:04.000Z (almost 12 years ago)
- Last Synced: 2023-04-08T06:22:32.767Z (about 3 years ago)
- Topics: lua
- Language: Lua
- Size: 172 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
printlogger
===========
print() to stdout and log files
example
=======
```
require("printlogger")
print.set_log_level("CUSTOM", io.open("customlevel", "wa"))
print("This will be printed and logged using the default log level (DEBUG)")
print(print.CUSTOM, "This will end up in the custom file")
print(print.WARN, "This will end up in the warning file")
print(print.DEBUG, "This will end up in the debug file")
print.set_log_level(print.DEBUG, nil) -- disable the debug level
print(print.DEBUG, "This will NOT be logged")
```