Ledger Nano X - The secure hardware wallet
SHARE
TWEET

ut(utilities)(API)

kssr3951 Apr 18th, 2015 236 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- -------------------------------
  2. -- ut - utilities(API)
  3. -- -------------------------------
  4. -- ---------------
  5. -- Logger
  6. -- ---------------
  7. -- do logging?
  8. DEBUG__DO_LOGGING           = true
  9. -- local log
  10. DEBUG__LOCAL_ENABLED        = true
  11. DEBUG__LOCAL_LOG_FILE_NAME  = "debug.log"
  12. -- remote log
  13. DEBUG__REMOTE_ENABLED       = false
  14. DEBUG__REMOTE_ADDR          = 20
  15. DEBUG__REMOTE_MODEM_DIR     = "right"
  16. function debug(txt)
  17.   if DEBUG__DO_LOGGING then
  18.     if DEBUG__LOCAL_ENABLED then
  19.       local hFile
  20.       if fs.exists(DEBUG__LOCAL_LOG_FILE_NAME) then
  21.         hFile = fs.open(DEBUG__LOCAL_LOG_FILE_NAME, "a");
  22.       else
  23.         hFile = fs.open(DEBUG__LOCAL_LOG_FILE_NAME, "w");
  24.       end
  25.       hFile.writeLine(txt);
  26.       hFile.close();
  27.     end
  28.     if DEBUG__REMOTE_ENABLED then
  29.       rednet.open(DEBUG__REMOTE_MODEM_DIR)
  30.       rednet.send(DEBUG__REMOTE_ADDR, txt)
  31.       rednet.close()
  32.     end
  33.   end
  34. end
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top