/** * Logs the given message, with the given log level if specified, to the standard platform/environment. * * @param level Log level * @param message Message to be logged * @since v2.0 */ public void Log(ILoggingLogLevel level, string message) { if (this._delegate != null) { this._delegate.Log(level, message); } }
/** * Invokes the given method specified in the API request object. * * @param request APIRequest object containing method name and parameters. * @return APIResponse with status code, message and JSON response or a JSON null string for void functions. Status code 200 is OK, all others are HTTP standard error conditions. */ public new APIResponse Invoke(APIRequest request) { APIResponse response = new APIResponse(); int responseCode = 200; String responseMessage = "OK"; String responseJSON = "null"; switch (request.GetMethodName()) { case "logLevelMessage": ILoggingLogLevel level0 = GetJSONProcessor().DeserializeObject <ILoggingLogLevel>(request.GetParameters()[0]); string message0 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]); this.Log(level0, message0); break; case "logLevelCategoryMessage": ILoggingLogLevel level1 = GetJSONProcessor().DeserializeObject <ILoggingLogLevel>(request.GetParameters()[0]); string category1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[1]); string message1 = GetJSONProcessor().DeserializeObject <string>(request.GetParameters()[2]); this.Log(level1, category1, message1); break; default: // 404 - response null. responseCode = 404; responseMessage = "LoggingBridge does not provide the function '" + request.GetMethodName() + "' Please check your client-side API version; should be API version >= v2.2.15."; break; } response.SetResponse(responseJSON); response.SetStatusCode(responseCode); response.SetStatusMessage(responseMessage); return(response); }