From dbc5ba66e1ee2476366ad2bee9334481e172208c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Tue, 5 Apr 2022 18:12:13 +0900 Subject: [PATCH] Trim excessive logs --- api.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/api.js b/api.js index 7c77fa3..d08e9a2 100644 --- a/api.js +++ b/api.js @@ -21,6 +21,15 @@ var BotanJS = function() util.inherits( BotanJS, events.EventEmitter ); +var _trim = function( s ) +{ + if( 100 < s.length ) + { + return "[BLOB: " + s.substr( 0, 20 ) + " ...]"; + } + return s; +}; + BotanJS.prototype.unshift = function() { for( var i in arguments ) @@ -107,7 +116,7 @@ BotanJS.prototype.compile = function( type ) { _self.storeForRender( rainet, type, ch ); - Dragonfly.Debug( "Storing " + ch + " to fastcache[ " + fastCache.id + " ]" ); + Dragonfly.Debug( "Storing " + _trim( ch ) + " to fastcache[ " + fastCache.id + " ]" ); fastCache.spawn( 10 ); fastCache.set( type, ch );