Exemplo n.º 1
0
        public void LogMessage(string Category, string Section, string Message, LogLevel loglevel = LogLevel.Verbose)
        {
            if (LogLevel > loglevel)
            {
                return;
            }

            var UnformattedMessage = "[{0}][{1}][{2}] {3}";
            var FormattedMessage   = string.Format(UnformattedMessage, DateTime.Now.ToString(DATETIME_FORMAT), Category.PadRight(CATEGORY_LENGHT), Section.PadRight(SECTION_LENGTH), Message);

            AddLogEvent?.Invoke(FormattedMessage);

            //    $"{DateTime.Now.ToString()}\t{Section}\t{Message}\t2\t{LoggedUser.Login}\n";
            //File.AppendAllText("log.txt", FormattedMessage);
        }
Exemplo n.º 2
0
 protected virtual void OnAddLogEvent(string logtxt)
 {
     AddLogEvent?.Invoke(logtxt);
 }
Exemplo n.º 3
0
 protected virtual void OnAddLogEvent()
 {
     AddLogEvent?.Invoke(this, EventArgs.Empty);
 }
 public static void AddLog(string _message, LogMessageType _logMessageType, string _feature = "")
 {
     AddLogEvent?.Invoke(_message, _logMessageType, _feature);
 }