changeset 477:49a14435cb56

Remove print_to_console.lua, bad way for debugging.
author Aleksandr Rybalko <ray@ddteam.net>
date Mon, 24 Sep 2012 14:45:03 +0300
parents 51d48b4d40ce
children 6c9a018ba342
files profiles/lua_web_ui/files/etc/www/devd.lua profiles/lua_web_ui/files/etc/www/httpd.lua profiles/lua_web_ui/files/etc/www/lib/print_to_console.lua
diffstat 3 files changed, 0 insertions(+), 36 deletions(-) [+]
line wrap: on
line diff
--- a/profiles/lua_web_ui/files/etc/www/devd.lua	Mon Sep 24 14:36:20 2012 +0300
+++ b/profiles/lua_web_ui/files/etc/www/devd.lua	Mon Sep 24 14:45:03 2012 +0300
@@ -10,9 +10,6 @@
 serverhost = serverhost or "127.0.0.1";
 serverport = serverport or "80";
 
--- redirect print to /dev/console
--- dofile("lib/print_to_console.lua");
-
 -- redirect print to syslog
 dofile("lib/lsyslog.lua");
 syslog_init("devd.lua");
--- a/profiles/lua_web_ui/files/etc/www/httpd.lua	Mon Sep 24 14:36:20 2012 +0300
+++ b/profiles/lua_web_ui/files/etc/www/httpd.lua	Mon Sep 24 14:45:03 2012 +0300
@@ -55,9 +55,6 @@
 -- HOSTAPD helper
 --dofile("lib/hostapd.lua");
 
--- redirect print to /dev/console
--- dofile("lib/print_to_console.lua");
-
 -- redirect print to syslog
 dofile("lib/lsyslog.lua");
 syslog_init("httpd.lua");
--- a/profiles/lua_web_ui/files/etc/www/lib/print_to_console.lua	Mon Sep 24 14:36:20 2012 +0300
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,30 +0,0 @@
-print_native = print;
-cons = io.open("/dev/console", "w");
-
--- XXX We need to find a way how to close it on signal
--- cons:close();
-
--- Write to stdout and console at the same time
-function console(...)
-	ret = 0;
-	out = string.gsub(string.format(...), "\n", "\r\n");
-	if cons then
-		ret = cons:write(out);
-	end
-	-- check if native print moved
-	if print_native then
-		print_native(out);
-	else
-		print(out);
-	end
-	return ret;
-end
-
-function progress(...)
-	console(...);
-end
-
-print = function (...)
-	-- "string.format" need raw string of "print" as a single string
-	console(table.concat(arg, "\t"):gsub("%%","%%%%") .. "\n");
-end