aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.CodeGeneration/Templates/Method.cshtml
blob: 3b54d4e57ed0f8f407f5b44b0f83bf9361c51ec2 (plain)
1
2
3
4
@(Model.GetModifierString()) @(Model.MethodModifier != CodeGenerator.MethodModifier.None ? Model.MethodModifier.ToString().ToLower() : null) @(Model.ReturnType) @(Model.Name)(@(Model.GetArgumentsString()))
            {
                  @Model.Content
            }
me.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Tango.Logging
{
    /// <summary>
    /// Represents an exception log item.
    /// </summary>
    [Serializable]
    public class ExceptionLogItem : LogItemBase
    {
        private bool _messageSet;

        [NonSerialized]
        private Exception _exception;
        /// <summary>
        /// Gets or sets the log item exception.
        /// </summary>
        public Exception Exception
        {
            get { return _exception; }
            set { _exception = value; }
        }

        /// <summary>
        /// Gets the log message.
        /// </summary>
        public override string Message { get; set; }

        /// <summary>
        /// Gets or sets the error description.
        /// </summary>
        public String Description { get; set; }

        /// <summary>
        /// Returns a formatted string of the log item.
        /// </summary>
        public override string ToString()
        {
            return String.Format("[{0}] [{6}] [{1}] [{2}] [{3}]: {4}{5}", TimeStamp.ToString("HH:mm:ss.ff"), GetRelativeCallerFilePath(), CallerMethodName, CallerLineNumber, Description, Environment.NewLine + Exception.FlattenException(), Category);
        }
    }
}