From 9a902fc1cf5517943cc8f99261854b95a666be68 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Tue, 20 May 2014 05:19:48 -0400 Subject: [PATCH] feature(console) make private log, error --- lib/client/console.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lib/client/console.js b/lib/client/console.js index 3a530039..52ac0203 100644 --- a/lib/client/console.js +++ b/lib/client/console.js @@ -12,6 +12,10 @@ var CloudCmd, Util, DOM, CloudFunc, $; }, Loading, jqconsole, + + log = Util.bind(write, 'log'), + error = Util.bind(write, 'error'), + Element, MouseBinded, Socket, @@ -40,8 +44,6 @@ var CloudCmd, Util, DOM, CloudFunc, $; } this.show = show; - this.log = log; - this.error = error; function show(callback) { if (!Loading) { @@ -112,15 +114,7 @@ var CloudCmd, Util, DOM, CloudFunc, $; } } - function log(pText) { - write(pText, 'log'); - } - - function error(pText) { - write(pText, 'error'); - } - - function write(msg, status) { + function write(status, msg) { var isContain; if (msg) { @@ -179,6 +173,7 @@ var CloudCmd, Util, DOM, CloudFunc, $; function onMessage(json) { if (json) { Util.log(json); + log(json.stdout); error(json.stderr); }