using UnityEngine;
namespace ES3Internal
{
internal static class ES3Debug
{
private const string disableInfoMsg = "\nTo disable these messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Info'";
private const string disableWarningMsg = "\nTo disable warnings from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Warnings'";
private const string disableErrorMsg = "\nTo disable these error messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Errors'";
private const char indentChar = '-';
public static void Log(string msg, Object context = null, int indent = 0)
{
if (ES3Settings.defaultSettingsScriptableObject.logDebugInfo)
{
if (context != null)
{
Debug.LogFormat(context, Indent(indent) + msg + "\nTo disable these messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Info'");
}
else
{
Debug.LogFormat(context, Indent(indent) + msg);
}
}
}
public static void LogWarning(string msg, Object context = null, int indent = 0)
{
if (ES3Settings.defaultSettingsScriptableObject.logWarnings)
{
if (context != null)
{
Debug.LogWarningFormat(context, Indent(indent) + msg + "\nTo disable warnings from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Warnings'");
}
else
{
Debug.LogWarningFormat(context, Indent(indent) + msg + "\nTo disable warnings from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Warnings'");
}
}
}
public static void LogError(string msg, Object context = null, int indent = 0)
{
if (ES3Settings.defaultSettingsScriptableObject.logErrors)
{
if (context != null)
{
Debug.LogErrorFormat(context, Indent(indent) + msg + "\nTo disable these error messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Errors'");
}
else
{
Debug.LogErrorFormat(context, Indent(indent) + msg + "\nTo disable these error messages from Easy Save, go to Window > Easy Save 3 > Settings, and uncheck 'Log Errors'");
}
}
}
private static string Indent(int size)
{
if (size < 0)
{
return "";
}
return new string('-', size);
}
}
}