Advertisement
GWibisono

GB_log

Aug 15th, 2016
574
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //=============================================================================
  2. // gbLog.js
  3. //=============================================================================
  4.  
  5. /*:
  6.  * @plugindesc log message
  7.  * @author G Bison
  8.  *
  9.  * @help This plugin does not provide plugin commands.
  10.  *
  11.  *
  12.  * Usage examples of this plugin:
  13.  * - log_add(your_log,type)
  14.  */
  15.  
  16. /*:ja
  17.  * @plugindesc メッセージをログに記録
  18.  * @author G Bison
  19.  *
  20.  * @help このプラグインにはプラグインコマンドはありません。
  21.  *
  22.  * 想定される用途:
  23.  * - log_add( メッセージ, タイプ )
  24.  */
  25. function log_add(message, type){
  26.     var d = new Date();
  27.     if(type==undefined){
  28.         type='infO';
  29.     }
  30. //  console.log(type);
  31.     txt=d.getFullYear()+'-'+d.getMonth()+'-'+d.getDate();
  32.     txt=txt+" "+d.getHours()+":"+d.getMinutes()+":"+d.getSeconds()+" ";
  33.     txt=txt+type.toUpperCase( )+' ';
  34.     txt=txt+message;
  35.     console.log(txt);
  36. }
  37. /***
  38. * simple (done)
  39. * array input?
  40. * show as Json
  41. ***/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement