using System.Diagnostics;
using System.Runtime.CompilerServices;
using Giant;
using Giant.Common;

using GiantUtilities = Giant.Common.GiantUtilities;
public static class LogUtils
{

    /// <summary>
    /// 日志信息
    /// </summary>
    /// <param name="args"></param>
    /// 
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void Log(string args, LogCategory category = LogCategory.GameLogic, UnityEngine.LogType logType = UnityEngine.LogType.Log)
    {
        ILogSystem.Log(category, args, logType);
    }
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void LogByCategory(LogCategory category, string args)
    {
        Log(args, category, UnityEngine.LogType.Log);
    }
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void Log(LogCategory category, string args)
    {
        Log(args, category, UnityEngine.LogType.Log);
    }
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void Log(params string[] args)
    {
        if (null != args)
        {
            Log(Giant.Common.GiantUtilities.BuildString(args));
        }
    }
    [Conditional("DEBUG")]
    public static void Log(params object[] args)
    {
        if (null != args)
        {
            Log(Giant.Common.GiantUtilities.BuildString(args));
        }
    }
    [Conditional("DEBUG")]
    public static void Log(LogCategory category, params object[] args)
    {
        if (null != args)
        {
            Log(category, GiantUtilities.BuildString(args));
        }
    }
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void Log(LogCategory category, params string[] args)
    {
        Log(GiantUtilities.BuildString(args), category);
    }

    /// <summary>
    /// 日志警告
    /// </summary>
    /// <param name="args"></param>
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void LogWarning(string args, LogCategory category = LogCategory.GameLogic)
    {
        ILogSystem.Log(category, args, UnityEngine.LogType.Warning);
    }
    [Conditional("DEBUG")]
    public static void LogWarning(LogCategory category, params object[] args)
    {
        LogWarning(GiantUtilities.BuildString(args), category);
    }
    [Conditional("DEBUG")]
    public static void LogWarning(params object[] args)
    {
        LogWarning(GiantUtilities.BuildString(args));
    }


    /// <summary>
    /// 日志错误
    /// </summary>
    /// <param name="args"></param>
    [Conditional("DEBUG")]
    [MethodImplAttribute(MethodImplOptions.AggressiveInlining)]
    public static void LogError(string args, LogCategory category = LogCategory.GameLogic)
    {
        ILogSystem.Log(category, args, UnityEngine.LogType.Error);
    }

    /// <summary>
    /// 日志错误
    /// </summary>
    /// <param name="args"></param>
    [Conditional("DEBUG")]
    public static void LogError(LogCategory category, params object[] args)
    {
        LogError(GiantUtilities.BuildString(args), category);
    }

    /// <summary>
    /// 日志错误
    /// </summary>
    /// <param name="args"></param>
    [Conditional("DEBUG")]
    public static void LogError(params object[] args)
    {
        LogError(GiantUtilities.BuildString(args));
    }
}