Exemplo n.º 1
0
        private String FormatMessage(String message, String category, ExecutionLogLevel logLevel)
        {
            String result = String.Empty;

            try
            {
                StringBuilder buffer = new StringBuilder(LogTimestamp.GetUtcNow());

                buffer.Append(" [E] ");
                buffer.Append(logLevel.ToString());
                buffer.Append(" (TID: ");
                buffer.Append(Thread.CurrentThread.ManagedThreadId.ToString());
                buffer.Append(")");
                buffer.Append(" (");
                buffer.Append(category);
                buffer.Append(") '");
                buffer.Append(message);
                buffer.Append("'");

                result = buffer.ToString();
            }catch
            {
                result = message;
            }

            return(result);
        }
Exemplo n.º 2
0
        private String FormatMessage(String message, bool incoming)
        {
            String result = String.Empty;

            try
            {
                StringBuilder buffer = new StringBuilder(LogTimestamp.GetUtcNow());

                buffer.Append(" [I] ");
                buffer.Append(this.LocalEndPoint);
                buffer.Append(" <-> ");
                buffer.Append(this.RemoteEndPoint);

                if (incoming == true)
                {
                    buffer.Append(" (R):");
                }
                else
                {
                    buffer.Append(" (S):");
                }

                buffer.Append(" '");
                buffer.Append(message);
                buffer.Append("'");

                result = buffer.ToString();
            }catch
            {
                result = message;
            }

            return(result);
        }