Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- -------------------------------
- -- ut - utilities(API)
- -- -------------------------------
- -- ---------------
- -- Logger
- -- ---------------
- -- do logging?
- DEBUG__DO_LOGGING = true
- -- local log
- DEBUG__LOCAL_ENABLED = true
- DEBUG__LOCAL_LOG_FILE_NAME = "debug.log"
- -- remote log
- DEBUG__REMOTE_ENABLED = false
- DEBUG__REMOTE_ADDR = 20
- DEBUG__REMOTE_MODEM_DIR = "right"
- function debug(txt)
- if DEBUG__DO_LOGGING then
- if DEBUG__LOCAL_ENABLED then
- local hFile
- if fs.exists(DEBUG__LOCAL_LOG_FILE_NAME) then
- hFile = fs.open(DEBUG__LOCAL_LOG_FILE_NAME, "a");
- else
- hFile = fs.open(DEBUG__LOCAL_LOG_FILE_NAME, "w");
- end
- hFile.writeLine(txt);
- hFile.close();
- end
- if DEBUG__REMOTE_ENABLED then
- rednet.open(DEBUG__REMOTE_MODEM_DIR)
- rednet.send(DEBUG__REMOTE_ADDR, txt)
- rednet.close()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement