private static void Execute(string url, string filePath, LogFormatEnum inputType, LogFormatEnum outputType) { WriteLine($"Downloading file from {url}"); var file = Client.GetFile(url); WriteLine($"Converting log from {inputType.ToString()} to {outputType.ToString()}"); var log = Logger.Conversion(file, inputType, outputType); WriteLine($"Saving log to {filePath}"); Archive.SaveLogFile(filePath, log); }
internal static string FromHttpBaseLog(IHttpBaseLog log, LogFormatEnum inputType) { switch (inputType) { case LogFormatEnum.MinhaCDN: return(new MinhaCDN(log).Content); case LogFormatEnum.Agora: return(new Agora(log).Content); default: throw new NotImplementedException(); } }
public LogOtherFactory(LogFormatEnum logFormat) { _logFormat = logFormat; }
public static string Conversion(string file, LogFormatEnum inputType, LogFormatEnum outputType) { var baseLog = ToHttpBaseLog(file, inputType); return(FromHttpBaseLog(baseLog, outputType)); }
public static string GetMessage(LogFormatEnum logFormat) { return($"Log Writer : {Enum.GetName(typeof(LogFormatEnum), logFormat)} is not implemented"); }
public NotImplementedLogFormat(LogFormatEnum logFormat) : base(GetMessage(logFormat)) { }