Пример #1
0
        public static void Log(Exception exception, MobileCenterLogType type = MobileCenterLogType.Warn)
        {
            var exceptionType = exception.GetType().ToString();
            var message       = exception.Message;

            System.Diagnostics.Debug.WriteLine(exceptionType);
            System.Diagnostics.Debug.WriteLine($"Error: {message}");

            switch (type)
            {
            case MobileCenterLogType.Info:
                MobileCenterLog.Info(exceptionType, message, exception);
                break;

            case MobileCenterLogType.Warn:
                MobileCenterLog.Warn(exceptionType, message, exception);
                break;

            case MobileCenterLogType.Error:
                MobileCenterLog.Error(exceptionType, message, exception);
                break;

            case MobileCenterLogType.Assert:
                MobileCenterLog.Assert(exceptionType, message, exception);
                break;

            case MobileCenterLogType.Verbose:
                MobileCenterLog.Verbose(exceptionType, message, exception);
                break;

            case MobileCenterLogType.Debug:
                MobileCenterLog.Debug(exceptionType, message, exception);
                break;

            default:
                throw new Exception("MobileCenterLogType Does Not Exist");
            }
        }
Пример #2
0
        public static void Log(string tag, string message, Exception exception = null, MobileCenterLogType type = MobileCenterLogType.Warn)
        {
            switch (type)
            {
            case MobileCenterLogType.Info:
                MobileCenterLog.Info(tag, message, exception);
                break;

            case MobileCenterLogType.Warn:
                MobileCenterLog.Warn(tag, message, exception);
                break;

            case MobileCenterLogType.Error:
                MobileCenterLog.Error(tag, message, exception);
                break;

            case MobileCenterLogType.Assert:
                MobileCenterLog.Assert(tag, message, exception);
                break;

            case MobileCenterLogType.Verbose:
                MobileCenterLog.Verbose(tag, message, exception);
                break;

            case MobileCenterLogType.Debug:
                MobileCenterLog.Debug(tag, message, exception);
                break;

            default:
                throw new Exception("MobileCenterLogType Does Not Exist");
            }
        }