Exemple #1
0
 private static void Fail(string message, bool useWarning = false)
 {
     if (useWarning)
     {
         Debug.LogWarning($"Assertion warning: {message}");
     }
     else
     {
         Debug.LogAssertion($"Assertion failed: {message}");
     }
 }
        private static void Log(string msg, LogChannel channel, LogLvl level)
        {
            // cease log that we do not want
            if ((int)level < (int)minimumLvl || !LogChannels.IsChannelActive(channel))
            {
                return;
            }

            string channelStr = LogChannels.GetChannelName(channel);
            string finalMsg   = string.Format("[ {0} ] - {1}", channelStr, msg);

            switch (level)
            {
            case LogLvl.Info:
                Debug.Log(finalMsg);
                break;

            case LogLvl.Warning:
                Debug.LogWarning(finalMsg);
                break;

            case LogLvl.Error:
                Debug.LogError(finalMsg);
                break;

            case LogLvl.Assertion:
                Debug.LogAssertion(finalMsg);
                break;

            case LogLvl.Exception:
                // TODO: Implementation
                break;

            default:
                Debug.LogFormat("The log level {0} does not exist", level.ToString());
                break;
            }
        }
Exemple #3
0
 public static void Assertion(string msg) => Debug.LogAssertion($"{TAG} {msg}");