Support for functional Log

This commit is contained in:
斟酌 鵬兄 2015-02-06 12:39:32 +08:00
parent 88f8bf9fac
commit bee10b992f

View File

@ -92,8 +92,13 @@ Dragonfly.prototype.Log = function( mesg, sphere, visibility )
write = ( this.currentSphere % 10 < sphere % 10 );
}
// Writeline if yes
write && this.writeLine( mesg );
if( write )
{
typeof( mesg ) == "function"
? mesg( this.writeLine )
: this.writeLine( mesg )
;
}
};
Dragonfly.prototype.writeLine = function ()