Changeset

731:c29cf3ffa3fc

Fixed server.lua to use prosody logger for errors
author Matthew Wild <mwild1@gmail.com>
date Fri, 16 Jan 2009 05:36:39 +0000
parents 730:ac951c44751c
children 732:0343739f3d71
files net/server.lua
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/net/server.lua	Fri Jan 16 05:22:28 2009 +0000
+++ b/net/server.lua	Fri Jan 16 05:36:39 2009 +0000
@@ -36,8 +36,10 @@
 local coroutine_wrap = coroutine.wrap
 local coroutine_yield = coroutine.yield
 local print = print;
+
+local log = require "util.logger".init("server");
 local out_put = function () end --print;
-local out_error = print;
+local out_error = function (...) log("error", table_concat({...}, " ")); end
 
 --// extern libs //--
 
@@ -797,7 +799,7 @@
 	addr = addr or "*"
 	local server, err = socket_bind( addr, port )
 	if err then
-		out_error( "server.lua: ", err )
+		out_error( addr..":"..port.." -", err )
 		return nil, err
 	end
 	local handler, err = wrapserver( listeners, server, addr, port, mode, sslctx, wrapper_function )    -- wrap new server socket