/// <summary>
 /// Log the specified reportLevel, service and message.
 /// </summary>
 /// <param name='reportLevel'>
 /// Report level.
 /// </param>
 /// <param name='service'>
 /// Service.
 /// </param>
 /// <param name='message'>
 /// Message.
 /// </param>
 public static void Log(AmazonLoggingLevel reportLevel, string service, string message)
 {
     if (AmazonLogging.EnableSDKLogging)
     {
         Debug.Log(string.Format(logMessage, service, message));
     }
 }
Esempio n. 2
0
    /// <summary>
    /// Logs the error.
    /// </summary>
    /// <param name='reportLevel'>
    /// Report level.
    /// </param>
    /// <param name='service'>
    /// Service.
    /// </param>
    /// <param name='message'>
    /// Message.
    /// </param>
    public static void LogError(AmazonLoggingLevel reportLevel, string service, string message)
    {
        if (reportLevel == AmazonLoggingLevel.Silent)
        {
            return;
        }

        string serviceAndMessage = string.Format(errorMessage, service, message);

        switch (reportLevel)
        {
        case AmazonLoggingLevel.ErrorsAsExceptions:
            throw new System.Exception(serviceAndMessage);

        case AmazonLoggingLevel.Critical:
        case AmazonLoggingLevel.Errors:
        case AmazonLoggingLevel.Warnings:
        case AmazonLoggingLevel.Verbose:
            Debug.LogError(serviceAndMessage);
            break;

        default:
            break;
        }
    }
Esempio n. 3
0
        /// <summary>
        /// Log the specified reportLevel, service and message.
        /// </summary>
        /// <param name='reportLevel'>
        /// Report level.
        /// </param>
        /// <param name='service'>
        /// Service.
        /// </param>
        /// <param name='message'>
        /// Message.
        /// </param>
        public static void Log(AmazonLoggingLevel reportLevel, string service, string message)
        {
            if(reportLevel != AmazonLoggingLevel.Verbose) {
                return;
            }

            Debug.Log(string.Format(logMessage,service,message));
        }
Esempio n. 4
0
    /// <summary>
    /// Log the specified reportLevel, service and message.
    /// </summary>
    /// <param name='reportLevel'>
    /// Report level.
    /// </param>
    /// <param name='service'>
    /// Service.
    /// </param>
    /// <param name='message'>
    /// Message.
    /// </param>
    public static void Log(AmazonLoggingLevel reportLevel, string service, string message)
    {
        if (reportLevel != AmazonLoggingLevel.Verbose)
        {
            return;
        }

        Debug.Log(string.Format(logMessage, service, message));
    }
        public static void LogException(AmazonLoggingLevel reportLevel, string service, Exception e)
        {
            if (reportLevel == AmazonLoggingLevel.Silent)
            {
                return;
            }

            string serviceAndMessage = string.Format(errorMessage, service, e.Message);

            if (AmazonLogging.EnableSDKLogging)
            {
                Debug.LogError(serviceAndMessage);
            }

            Debug.LogException(e);
        }
Esempio n. 6
0
    /// <summary>
    /// Logs the warning.
    /// </summary>
    /// <param name='reportLevel'>
    /// Report level.
    /// </param>
    /// <param name='service'>
    /// Service.
    /// </param>
    /// <param name='message'>
    /// Message.
    /// </param>
    public static void LogWarning(AmazonLoggingLevel reportLevel, string service, string message)
    {
        switch (reportLevel)
        {
        case AmazonLoggingLevel.Silent:
        case AmazonLoggingLevel.Critical:
        case AmazonLoggingLevel.ErrorsAsExceptions:
        case AmazonLoggingLevel.Errors:
            // Do not log warnings at these levels.
            break;

        case AmazonLoggingLevel.Warnings:
        case AmazonLoggingLevel.Verbose:
            Debug.LogWarning(string.Format(warningMessage, service, message));
            break;
        }
    }
Esempio n. 7
0
 /// <summary>
 /// Logs the error.
 /// </summary>
 /// <param name='reportLevel'>
 /// Report level.
 /// </param>
 /// <param name='service'>
 /// Service.
 /// </param>
 /// <param name='message'>
 /// Message.
 /// </param>
 public static void LogError(AmazonLoggingLevel reportLevel, string service, string message) {
     if(reportLevel == AmazonLoggingLevel.Silent) {
         return;
     }
         
     string serviceAndMessage = string.Format(errorMessage,service,message);
     
     switch(reportLevel) {
     case AmazonLoggingLevel.ErrorsAsExceptions:
         throw new System.Exception(serviceAndMessage);
     case AmazonLoggingLevel.Critical:
     case AmazonLoggingLevel.Errors:
     case AmazonLoggingLevel.Warnings:
     case AmazonLoggingLevel.Verbose:
         Debug.LogError(serviceAndMessage);
         break;
     default:
         break;
     }
 }
Esempio n. 8
0
    /// <summary>
    /// Converts the plugin logging level to the SDK logging level.
    /// </summary>
    /// <returns>
    /// The to SDK logging level.
    /// </returns>
    /// <param name='pluginLoggingLevel'>
    /// Plugin logging level.
    /// </param>
    public static SDKLoggingLevel pluginToSDKLoggingLevel(AmazonLoggingLevel pluginLoggingLevel)
    {
        switch (pluginLoggingLevel)
        {
        case AmazonLoggingLevel.Silent:
            return(SDKLoggingLevel.LogOff);

        case AmazonLoggingLevel.Critical:
            return(SDKLoggingLevel.LogCritical);

        case AmazonLoggingLevel.Errors:
        case AmazonLoggingLevel.ErrorsAsExceptions:
            return(SDKLoggingLevel.LogError);

        case AmazonLoggingLevel.Warnings:
        case AmazonLoggingLevel.Verbose:
            return(SDKLoggingLevel.LogWarning);

        default:
            // The default SDK logging level is warning
            return(SDKLoggingLevel.LogWarning);
        }
    }
Esempio n. 9
0
 /// <summary>
 /// Converts the plugin logging level to the SDK logging level.
 /// </summary>
 /// <returns>
 /// The to SDK logging level.
 /// </returns>
 /// <param name='pluginLoggingLevel'>
 /// Plugin logging level.
 /// </param>
 public static SDKLoggingLevel pluginToSDKLoggingLevel(AmazonLoggingLevel pluginLoggingLevel)
 {
     switch(pluginLoggingLevel) {
     case AmazonLoggingLevel.Silent:
         return SDKLoggingLevel.LogOff;
     case AmazonLoggingLevel.Critical:
         return SDKLoggingLevel.LogCritical;
     case AmazonLoggingLevel.Errors:
     case AmazonLoggingLevel.ErrorsAsExceptions:
         return SDKLoggingLevel.LogError;
     case AmazonLoggingLevel.Warnings:
     case AmazonLoggingLevel.Verbose:
         return SDKLoggingLevel.LogWarning;
     default:
         // The default SDK logging level is warning
         return SDKLoggingLevel.LogWarning;
     }
 }
Esempio n. 10
0
 /// <summary>
 /// Logs the warning.
 /// </summary>
 /// <param name='reportLevel'>
 /// Report level.
 /// </param>
 /// <param name='service'>
 /// Service.
 /// </param>
 /// <param name='message'>
 /// Message.
 /// </param>
 public static void LogWarning(AmazonLoggingLevel reportLevel, string service, string message)
 {
     switch(reportLevel) {
     case AmazonLoggingLevel.Silent:
     case AmazonLoggingLevel.Critical:
     case AmazonLoggingLevel.ErrorsAsExceptions:
     case AmazonLoggingLevel.Errors:
         // Do not log warnings at these levels.
         break;
     case AmazonLoggingLevel.Warnings:
     case AmazonLoggingLevel.Verbose:
         Debug.LogWarning(string.Format(warningMessage,service,message));
         break;
     }
 }