| | 1 | | using DCL.Interface; |
| | 2 | | using UnityEngine; |
| | 3 | |
|
| | 4 | | namespace DCL.LogReport |
| | 5 | | { |
| | 6 | | public class LogReportKernelInterface |
| | 7 | | { |
| | 8 | | [System.Serializable] |
| | 9 | | public class LogReportPayload |
| | 10 | | { |
| | 11 | | public string type; |
| | 12 | | public string message; |
| | 13 | | } |
| | 14 | |
|
| 0 | 15 | | private static LogReportPayload logReportPayload = new LogReportPayload(); |
| | 16 | |
|
| | 17 | | public static void ReportLog(LogType type, string message) |
| | 18 | | { |
| | 19 | | switch (type) |
| | 20 | | { |
| | 21 | | case LogType.Error: |
| 0 | 22 | | ReportLog("error", message); |
| 0 | 23 | | break; |
| | 24 | | case LogType.Assert: |
| 0 | 25 | | ReportLog("warning", message); |
| 0 | 26 | | break; |
| | 27 | | case LogType.Exception: |
| 0 | 28 | | ReportLog("error", message); |
| 0 | 29 | | break; |
| | 30 | | case LogType.Warning: |
| 0 | 31 | | ReportLog("warning", message); |
| 0 | 32 | | break; |
| | 33 | | default: |
| 0 | 34 | | ReportLog("log", message); |
| | 35 | | break; |
| | 36 | | } |
| 0 | 37 | | } |
| | 38 | |
|
| | 39 | | public static void ReportLog(string type, string message) |
| | 40 | | { |
| 0 | 41 | | logReportPayload.type = type; |
| 0 | 42 | | logReportPayload.message = message; |
| 0 | 43 | | WebInterface.SendMessage("ReportLog", logReportPayload); |
| 0 | 44 | | } |
| | 45 | | } |
| | 46 | | } |