Example #1
0
 /// <summary>
 /// Creates a new instance of the class with the specified parameters.
 /// </summary>
 /// <param name="timestamp">A DateTime specifying the timestamp of the entry.</param>
 /// <param name="priority">A LogFileEntryPriority indicating the priority of the entry.</param>
 /// <param name="component">A string containing the name of the component that created the entry.</param>
 /// <param name="operation">A string containing the name of the operation being executed when the entry was created.</param>
 /// <param name="message">A string containing the message of the entry.</param>
 internal LogFileEntry(DateTime timestamp, LogFileEntryPriority priority, string component, string operation, string message)
 {
     Timestamp = timestamp;
     Priority  = priority;
     Component = component;
     Operation = operation;
     Message   = message;
 }
Example #2
0
        /// <summary>
        /// Logs a message.
        /// </summary>
        /// <param name="priority">A LogFileEntryPriority indicating the priority of the message.</param>
        /// <param name="message">A string containing the message to be logged.</param>
        public static void LogMessage(LogFileEntryPriority priority, string message)
        {
            LogFileEntry Entry;

            GetSourceDetails(out string Component, out string Operation);
            Entry = new LogFileEntry(priority, Component, Operation, message);
            LogFile.WriteEntry(Entry);
        }
Example #3
0
 /// <summary>
 /// Logs a message.
 /// </summary>
 /// <param name="priority">A LogFileEntryPriority indicating the priority of the message.</param>
 /// <param name="message">A string containing the message to be logged.</param>
 /// <param name="args">An object used to format the message string.</param>
 public static void LogMessage(LogFileEntryPriority priority, string message, params object[] args)
 {
     LogMessage(priority, string.Format(message, args));
 }
Example #4
0
 /// <summary>
 /// Logs a message.
 /// </summary>
 /// <param name="priority">A LogFileEntryPriority indicating the priority of the message.</param>
 /// <param name="message">A string containing the message to be logged.</param>
 /// <param name="arg0">An object used to format the message string.</param>
 public static void LogMessage(LogFileEntryPriority priority, string message, object arg0)
 {
     LogMessage(priority, string.Format(message, arg0));
 }
Example #5
0
 /// <summary>
 /// Creates a new instance of the class with the specified parameters.
 /// </summary>
 /// <param name="priority">A LogFileEntryPriority indicating the priority of the entry.</param>
 /// <param name="component">A string containing the name of the component that created the entry.</param>
 /// <param name="operation">A string containing the name of the operation being executed when the entry was created.</param>
 /// <param name="message">A string containing the message of the entry.</param>
 internal LogFileEntry(LogFileEntryPriority priority, string component, string operation, string message)
     : this(DateTime.Now, priority, component, operation, message)
 {
 }