コード例 #1
0
ファイル: Logger.cs プロジェクト: geovanifg/Tupy.Logger
        public static bool WriteEntry(string source, string message, EventEntryTypes type, string data, [Optional] string category, [Optional] string userName, [Optional] string machineName)
        {
            var entry = new EventEntry()
            {
                Source      = source,
                Message     = message,
                EntryType   = type,
                Data        = data,
                Category    = category,
                UserName    = userName,
                MachineName = machineName
            };

            return(WriteEntry(entry));
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: geovanifg/Tupy.Logger
        private void btnRegister_Click(object sender, System.EventArgs e)
        {
            var             src  = "";
            EventEntryTypes type = EventEntryTypes.Error;

            if (rdbError.Checked)
            {
                src  = "InfiniteRetentionPeriod";
                type = EventEntryTypes.Error;
            }
            else if (rdbWarning.Checked)
            {
                src  = "FiveMinutes";
                type = EventEntryTypes.Warning;
            }
            else if (rdbInformation.Checked)
            {
                src  = "OneHour";
                type = EventEntryTypes.Information;
            }

            Logger.WriteEntry(src, txtMessage.Text, type);
        }
コード例 #3
0
ファイル: Logger.cs プロジェクト: geovanifg/Tupy.Logger
 public static bool WriteEntry(string source, string message, EventEntryTypes type, string data)
 {
     return(WriteEntry(source, message, type, data, category: null));
 }
コード例 #4
0
ファイル: Logger.cs プロジェクト: geovanifg/Tupy.Logger
 public static bool WriteEntry(string source, string message, EventEntryTypes type)
 {
     return(WriteEntry(source, message, type, null));
 }