Exemple #1
0
 public static string GlobalGeneric(LogUpdate update, string format, string time)
 {
     return(String.Format(
                format,
                time,
                update.Type.ToString(),
                update.File,
                String.Join(
                    NEW_LINE,
                    update.LogContent
                    )
                ));
 }
Exemple #2
0
 public static string GlobalHTTP(LogUpdate update, string format, string time)
 {
     return(String.Format(
                format,
                time,
                "HTTP",
                update.LogContent[0],
                String.Join(
                    NEW_LINE,
                    update.LogContent.Skip(1)
                    )
                ));
     //OnEntry(this, update.LogName, entry);
 }
Exemple #3
0
        public static LogEntry GlobalDATA(LogUpdate update)
        {
            LogEntry logEntry = new LogEntry();

            logEntry.LogName     = update.LogName;
            logEntry.FileName    = update.LogContent.First().ToString();
            logEntry.IsFile      = true;
            logEntry.FileContent = String.Join(
                NEW_LINE,
                update.FileContent.Select(
                    o => JSON.Serialize(o)
                    )
                );
            logEntry.Type = EntryType.DATA;

            return(logEntry);
        }
Exemple #4
0
        public static LogEntry GlobalFILE(LogUpdate update, string format, string time)
        {
            LogEntry logEntry = GlobalDATA(update);

            logEntry.Type  = EntryType.FILE;
            logEntry.Entry = String.Format(
                format,
                time,
                update.Type.ToString(),
                update.File,
                Path.GetDirectoryName(logEntry.FileName) + logEntry.FileName
                );

            return(logEntry);

            //OnEntry(this, update.LogName, entry);
        }
Exemple #5
0
        private static LogEntry GlobalFormatting(LogUpdate update)
        {
            if (update.Type == EntryType.DictionaryEntry)
            {
                return new LogEntry()
                       {
                           Type    = EntryType.DICTIONARY,
                           Entry   = update.LogContent.Single().ToString(),
                           IsFile  = false,
                           LogName = update.LogName
                       }
            }
            ;
            else
            {
                string time = LogManager.GetDefaultTimeFormat(update.Timestamp);

                if (update.Type == EntryType.HTTP)
                {
                    return new LogEntry()
                           {
                               Entry   = GlobalHTTP(update),
                               LogName = update.LogName,
                               IsFile  = false,
                               Type    = EntryType.HTTP
                           }
                }
                ;
                else if (update.FileContent.Length > 0)
                {
                    return(update.Type == EntryType.DATA ? GlobalDATA(update) : GlobalFILE(update));
                }
                else
                {
                    return new LogEntry()
                           {
                               Entry   = GlobalGeneric(update),
                               LogName = update.LogName,
                               Type    = update.Type,
                               IsFile  = false
                           }
                };
            }
        }
Exemple #6
0
 public static string GlobalGeneric(LogUpdate update, string format)
 {
     return(GlobalGeneric(update, format, LogManager.GetDefaultTimeFormat()));
 }
Exemple #7
0
 public static string GlobalGeneric(LogUpdate update)
 {
     return(GlobalGeneric(update, LogManager.Format));
 }
Exemple #8
0
 public static string GlobalHTTP(LogUpdate update)
 {
     return(GlobalHTTP(update, LogManager.Format, LogManager.GetDefaultTimeFormat()));
 }
Exemple #9
0
 public static LogEntry GlobalFILE(LogUpdate update, string format)
 {
     return(GlobalFILE(update, format, LogManager.GetDefaultTimeFormat()));
 }
Exemple #10
0
 public static LogEntry GlobalFILE(LogUpdate update)
 {
     return(GlobalFILE(update, LogManager.Format));
 }