Amazon.Runtime.Internal.Util.Logger.Error C# (CSharp) Метод

Error() публичный Метод

public Error ( Exception exception, string messageFormat ) : void
exception System.Exception
messageFormat string
Результат void
        public void Error(Exception exception, string messageFormat, params object[] args)
        {
            foreach (InternalLogger logger in loggers)
            {
                if (logger.IsEnabled && logger.IsErrorEnabled)
                    logger.Error(exception, messageFormat, args);
            }
        }

Usage Example

Пример #1
0
        /// <summary>
        /// This method processes queued web requests and user callbacks.
        /// </summary>
        void ProcessRequests()
        {
            // Make a network call for queued requests on the main thread
            var request = UnityRequestQueue.Instance.DequeueRequest();

            if (request != null)
            {
                StartCoroutine(InvokeRequest(request));
            }

            // Invoke queued callbacks on the main thread
            var asyncResult = UnityRequestQueue.Instance.DequeueCallback();

            if (asyncResult != null && asyncResult.Action != null)
            {
                try
                {
                    asyncResult.Action(asyncResult.Request, asyncResult.Response,
                                       asyncResult.Exception, asyncResult.AsyncOptions);
                }
                catch (Exception exception)
                {
                    // Catch any unhandled exceptions from the user callback
                    // and log it.
                    _logger.Error(exception,
                                  "An unhandled exception was thrown from the callback method {0}.",
                                  asyncResult.Request.ToString());
                }
            }

            //Invoke queued main thread executions
            var mainThreadCallback = UnityRequestQueue.Instance.DequeueMainThreadOperation();

            if (mainThreadCallback != null)
            {
                try
                {
                    mainThreadCallback();
                }
                catch (Exception exception)
                {
                    // Catch any unhandled exceptions from the user callback
                    // and log it.
                    _logger.Error(exception,
                                  "An unhandled exception was thrown from the callback method");
                }
            }

            //trigger network updates if status has changed
            var nr = ServiceFactory.Instance.GetService <INetworkReachability>() as Amazon.Util.Internal.PlatformServices.NetworkReachability;

            if (_currentNetworkStatus != nr.NetworkStatus)
            {
                _currentNetworkStatus = nr.NetworkStatus;
                nr.OnNetworkReachabilityChanged(_currentNetworkStatus);
            }
        }
All Usage Examples Of Amazon.Runtime.Internal.Util.Logger::Error