public void LogMessage(TkLogMessage message)
 {
     if (message.Level >= MinLevel)
     {
         m_timer = m_timeToLog;
         m_messageQueue.Enqueue(message);
     }
 }
        private static void LogToDestinations(TkLogMessage message, Object context, bool logToUnity = true)
        {
            if (EnableUnityLogger && logToUnity)
            {
                s_unityLogDestination.LogMessage(message, context);
            }

            foreach (var destination in Destinations)
            {
                destination.LogMessage(message, context);
            }
        }
        public void LogMessage(TkLogMessage message, Object context)
        {
            var sb = m_stringBuilders.Value;

            sb.Clear();

            sb.AppendFormat("[{0}] [{1}] ", m_currentFrame, message.LoggerName);
            message.Print(sb);

            sb.Append("\n\n");

            bool foundException = false;

            if (message.Params != null)
            {
                foreach (var messageParam in message.Params)
                {
                    if (string.CompareOrdinal(messageParam.Id, TkLoggerConstants.EXCEPTION_MESSAGE_KEY) == 0)
                    {
                        foundException = true;
                        sb.Append(messageParam.Value);
                    }

                    if (string.CompareOrdinal(messageParam.Id, TkLoggerConstants.EXCEPTION_STACKTRACE_KEY) == 0)
                    {
                        sb.Append("\n");
                        sb.Append(messageParam.Value);
                    }
                }
            }

            if (!foundException)
            {
                sb.Append(message.StackTrace);
            }

            sb.Append(TkLoggerConstants.UNITY_LOG_MARKER);

            try {
                var logType = LevelToType(message.Level);
                Debug.LogFormat(logType, LogOption.NoStacktrace, context, sb.ToString());
            } catch (Exception) {
                Debug.LogError("Exception while trying to log a message. Likely one of its params is not set. Message:\n\n" + sb);
            }
        }
 public void LogMessage(TkLogMessage message)
 {
     LogMessage(message, null);
 }
 public void LogMessage(TkLogMessage message, Object context)
 {
     LogMessage(message);
 }