Exemple #1
0
 internal static void SetLog(DLogType type, Object sender, string message)
 {
     if (OnLog != null)
     {
         OnLog(type, sender, message);
     }
 }
Exemple #2
0
    private static bool IsShow(DLogType _type)
    {
        int ret = (int)_type - (int)MinLogType;

        if (ret < 0)
        {
            return(false);
        }
        return(true);
    }
Exemple #3
0
    public static void LOGColor(DLogType _type, string _msg, LogColor _color)
    {
        if (!IsShow(_type))
        {
            return;
        }

        StringBuilder tbuilder = new StringBuilder();

        tbuilder.Append(_msg == null ? "Null" : _msg);

        string tcolorstr = ColorString(_color);

        if (tcolorstr != null)
        {
            tbuilder.Insert(0, tcolorstr);
            tbuilder.Append("</color>");
        }

        string tmsg = tbuilder.ToString();

        switch (_type)
        {
        case DLogType.TrueLog:
        case DLogType.Log:
            UnityEngine.Debug.Log(tmsg);
            break;

        case DLogType.Error:
            UnityEngine.Debug.LogError(tmsg);
            break;

        case DLogType.Warning:
            UnityEngine.Debug.LogWarning(tmsg);
            break;

        case DLogType.Assert:
            UnityEngine.Debug.LogAssertion(tmsg);
            break;

        default:
            break;
        }
    }
Exemple #4
0
        static void DLogMgt_OnLog(DLogType type, object sender, string message)
        {
            StringBuilder sb = new StringBuilder();

            switch (type)
            {
            default:
            case DLogType.Debug:
            {
                sb.Append("[KDT] ");
                break;
            }

            case DLogType.Error:
            {
                sb.Append("[KDT_ERROR] ");
                if (sender == null)
                {
                    sb.Append("[NULL] ");
                }
                else
                {
                    sb.Append(sender.ToString() + " ");
                }
                break;
            }

            case DLogType.Warning:
            {
                sb.Append("[KDT_WARNING] ");
                break;
            }
            }
            if (message == null)
            {
                sb.Append("[NULL]");
            }
            else
            {
                sb.Append(message);
            }
            MessageBox.Show(sb.ToString());
        }
 public static void LogWarning(object message, Object context, DLogType type = DLogType.Warning)
 {
     UnityEngine.Debug.LogWarning("[" + type + "] " + message, context);
 }
 public static void LogError(object message, Object context, DLogType type = DLogType.Error)
 {
     UnityEngine.Debug.Log("[" + type + "] " + message, context);
 }
 public static void LogError(object message, DLogType type = DLogType.Error)
 {
     UnityEngine.Debug.LogError("[" + type + "] " + message);
 }
 public static void LogFormat(Object context, string format, DLogType type = DLogType.Log, params object[] args)
 {
     UnityEngine.Debug.LogFormat(context, "[" + type + "] " + format, args);
 }
Exemple #9
0
 internal static void SetLog(DLogType type, string message)
 {
     SetLog(type, null, message);
 }