@@ -30,8 +30,7 @@ APIResponder(addr::String, ctx::Context=Context(), bound::Bool=true, id=nothing,
3030APIResponder (ip:: IPv4 , port:: Int , ctx:: Context = Context ()) = APIResponder (" tcp://$ip :$port " , ctx)
3131
3232function Base. show (io:: IO , x:: APIResponder )
33- println (io, " JuliaWebAPI.APIResponder with endpoints:" )
34- Base. show_comma_array (io, keys (x. endpoints), " " ," " )
33+ print (io, " JuliaWebAPI.APIResponder with $(length (x. endpoints)) endpoints (" , join (keys (x. endpoints), " ," ), " )" )
3534end
3635
3736function default_endpoint (f:: Function )
@@ -50,7 +49,7 @@ TODO: validate method belongs to module?
5049function register (conn:: APIResponder , f:: Function ;
5150 resp_json:: Bool = false ,
5251 resp_headers:: Dict = Dict {String,String} (), endpt= default_endpoint (f))
53- @debug (" registering" , endpt)
52+ @info (" registering" , endpt)
5453 conn. endpoints[endpt] = APISpec (f, resp_json, resp_headers)
5554 return conn # make fluent api possible
5655end
@@ -147,11 +146,7 @@ function process(conn::APIResponder; async::Bool=false)
147146 respond (conn, nothing , :terminate , " " )
148147 break
149148 else
150- @static if isdefined (Base, Symbol (" @error" ))
151- @error (" invalid control command " , command)
152- else
153- err (" invalid control command " , command)
154- end
149+ @error (" invalid control command " , command)
155150 continue
156151 end
157152 end
@@ -200,9 +195,5 @@ function logerr(msg, ex)
200195 iob = IOBuffer ()
201196 write (iob, msg)
202197 showerror (iob, ex)
203- @static if isdefined (Base, Symbol (" @error" ))
204- @error (String (take! (iob)))
205- else
206- err (String (take! (iob)))
207- end
198+ @error (String (take! (iob)))
208199end
0 commit comments