private static void LogHeader(ILoggerSync logger, AppOptions options) { logger.PostEntry("SQL Scripting Application"); logger.PostEntry(typeof(Program).Assembly.GetName().Version.ToString()); var lines = new List <string> { string.Concat("Server ", options.Server), string.Concat("Output Folder ", options.OutputFolder), string.Concat("Log Folder ", options.LogFolder), string.Concat("Included DBs ", string.Join(", ", options.IncludeDatabases)), string.Concat("Excluded DBs ", string.Join(", ", options.ExcludeDatabases)), string.Concat("Script UDFs ", options.ScriptFunctions), string.Concat("Script Sprocs ", options.ScriptStoredProcedures), string.Concat("Script Tables ", options.ScriptTables), string.Concat("Script Views ", options.ScriptViews), }; lines.ForEach(l => logger.PostEntryNoTimestamp(l)); }
private static void LogHeader(ILoggerSync logger, AppOptions options) { logger.PostEntry("SQL Scripting Application"); logger.PostEntry(typeof (Program).Assembly.GetName().Version.ToString()); var lines = new List<string> { string.Concat("Server ", options.Server), string.Concat("Output Folder ", options.OutputFolder), string.Concat("Log Folder ", options.LogFolder), string.Concat("Included DBs ", string.Join(", ", options.IncludeDatabases)), string.Concat("Excluded DBs ", string.Join(", ", options.ExcludeDatabases)), string.Concat("Script UDFs ", options.ScriptFunctions), string.Concat("Script Sprocs ", options.ScriptStoredProcedures), string.Concat("Script Tables ", options.ScriptTables), string.Concat("Script Views ", options.ScriptViews), }; lines.ForEach(l => logger.PostEntryNoTimestamp(l)); }
private static void SendLogFilePathToExchange(ILoggerSync logger, IRollingFileLogSink fileLogSink, AppOptions options) { try { if (string.IsNullOrWhiteSpace(options.ExchangePath)) { logger.PostEntry("Exchange -e option not set, skipping."); return; } logger.PostEntry("Attempting connection to UI Host '" + SharedConst.LogExchangeNetPipe + "'."); var endPoint = new EndpointAddress(SharedConst.LogExchangeNetPipe); var pipeFactory = new ChannelFactory <ILogExchange>(new NetNamedPipeBinding(), endPoint); var logExchange = pipeFactory.CreateChannel(); logExchange.ReportLogFilePath(fileLogSink.CurrentLogFilePath ?? "Path not found."); } catch (EndpointNotFoundException ex) { logger.PostException(ex); } }
private static void SendLogFilePathToExchange(ILoggerSync logger, IRollingFileLogSink fileLogSink, AppOptions options) { try { if (string.IsNullOrWhiteSpace(options.ExchangePath)) { logger.PostEntry("Exchange -e option not set, skipping."); return; } logger.PostEntry("Attempting connection to UI Host '" + SharedConst.LogExchangeNetPipe + "'."); var endPoint = new EndpointAddress(SharedConst.LogExchangeNetPipe); var pipeFactory = new ChannelFactory<ILogExchange>(new NetNamedPipeBinding(), endPoint); var logExchange = pipeFactory.CreateChannel(); logExchange.ReportLogFilePath(fileLogSink.CurrentLogFilePath ?? "Path not found."); } catch(EndpointNotFoundException ex) { logger.PostException(ex); } }