public void AddMessage()

in src/AWS.Logger.Core/Core/AWSLoggerCore.cs [291:313]


        public void AddMessage(string rawMessage)
        {
            if (string.IsNullOrEmpty(rawMessage))
            {
                rawMessage = EMPTY_MESSAGE;
            }

            // Only do the extra work of breaking up the message if the max unicode bytes exceeds the possible size. This is not
            // an exact measurement since the string is UTF8 but it gives us a chance to skip the extra computation for 
            // typically small messages.
            if (Encoding.Unicode.GetMaxByteCount(rawMessage.Length) < MAX_MESSAGE_SIZE_IN_BYTES)
            {
                AddSingleMessage(rawMessage);
            }
            else
            {
                var messageParts = BreakupMessage(rawMessage);
                foreach (var message in messageParts)
                {
                    AddSingleMessage(message);
                }
            }
        }