ufal/mtmonkey

API: status messages

Opened this issue · 2 comments

I think the API should allow more reporting than just errors. Like warnings, debug info, other meta info. But how? Perhaps a single mechanism in combination with errors?

msgLevel: 0 = none, 1 = information, 2 = warning, 3 = error
msgText: "OK"  (for msgLevel 0)

I use a simpler way, just warnings here, but this is not ideal:
http://zardoz.service.rug.nl:9070/rpc?action=translate&sourceLang=en&targetLang=nl&text=This+is+a+test.&nBestSize=3

I'm not sure -- think that debug info and possibly even warnings should rather be logged on the server than reported to the user (all the more if they are not the user's fault)... but technically it's not a problem to allow this.

I would suggest having errorCode (as before), errorLevel (the msgLevel as you suggested), and errorMessage (would contain warnings for errorCode == 0 and errorLevel > 0).