@@ -30,8 +30,7 @@ APIResponder(addr::String, ctx::Context=Context(), bound::Bool=true, id=nothing,
30
30
APIResponder (ip:: IPv4 , port:: Int , ctx:: Context = Context ()) = APIResponder (" tcp://$ip :$port " , ctx)
31
31
32
32
function 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), " ," ), " )" )
35
34
end
36
35
37
36
function default_endpoint (f:: Function )
@@ -50,7 +49,7 @@ TODO: validate method belongs to module?
50
49
function register (conn:: APIResponder , f:: Function ;
51
50
resp_json:: Bool = false ,
52
51
resp_headers:: Dict = Dict {String,String} (), endpt= default_endpoint (f))
53
- @debug (" registering" , endpt)
52
+ @info (" registering" , endpt)
54
53
conn. endpoints[endpt] = APISpec (f, resp_json, resp_headers)
55
54
return conn # make fluent api possible
56
55
end
@@ -147,11 +146,7 @@ function process(conn::APIResponder; async::Bool=false)
147
146
respond (conn, nothing , :terminate , " " )
148
147
break
149
148
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)
155
150
continue
156
151
end
157
152
end
@@ -200,9 +195,5 @@ function logerr(msg, ex)
200
195
iob = IOBuffer ()
201
196
write (iob, msg)
202
197
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)))
208
199
end
0 commit comments