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; } }
private static string CreateMessage(string message, LogLvl lvl = LogLvl.Debug) { return($"[{DateTime.Now:T}][{lvl.ToString()[0]}]:{message}"); }