ufal / mtmonkey

Distributed infrastructure for Machine Translation web services (using Moses, Python, JSON-RPC/web interface)
Other
33 stars 9 forks source link

API: status messages #7

Open pebbe opened 10 years ago

pebbe commented 10 years ago

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

tuetschek commented 10 years ago

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.

tuetschek commented 10 years ago

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