public static bool ParseFiles(bool force) { if (force || CheckIfFileParsingNeeded()) { ILoggerScope logger = null; try { logger = m_rootLogger.LogEntering("StepBro.Main", "Starting file parsing"); foreach (var f in m_loadedFilesManager.ListFiles <ScriptFile>()) { f.ResetBeforeParsing(preserveUpdateableElements: force == false); } m_lastParsingErrorCount = FileBuilder.ParseFiles(m_serviceManagerAdmin.Manager, logger); } finally { logger.LogExit("StepBro.Main", $"Ended file parsing. {m_lastParsingErrorCount} errors."); } return(m_lastParsingErrorCount == 0); } else { return(true); // Success (at least no failures) ... } }
private string GetScopeString() { if (_loggerScope == null) { return(null); } List <string> scopeList = new List <string>(); ILoggerScope pointer = _loggerScope; while (pointer != null) { string scopeItem = pointer.ToString(); if (!string.IsNullOrEmpty(scopeItem)) { scopeList.Add(scopeItem); } pointer = pointer.Parent; } scopeList.Reverse(); string scopeProperty = string.Join(" => ", scopeList); if (string.IsNullOrEmpty(scopeProperty)) { return(null); } return(scopeProperty); }
public IDisposable BeginScope <TState>(TState state) { LoggerScope newScope = new LoggerScope(_loggerScope, state); if (newScope != null) { _loggerScope = newScope; } return(_loggerScope); }
public void InternalDispose() { m_statusUpdaterOnEntry.ClearSublevels(); m_loggerInsideScope?.Dispose(); m_loggerInside = null; m_loggerInsideScope = null; //m_createdlogger.Dispose(); //if (m_firstCreatedStatusUpdater != null) //{ // m_firstCreatedStatusUpdater.Dispose(); //} }
private void SetupFromProcedure() { m_loggingEnabled = GetContextLoggingState( m_parentContext != null ? m_parentContext.m_loggingEnabled : true, m_loggerOnEntry.IsDebugging, m_callLoggingOption, m_procedure.LogOption); if (m_loggingEnabled || m_parentContext == null || m_parentContext.LoggingEnabled) { m_loggerInsideScope = m_loggerOnEntry.LogEntering((m_isDynamicCall ? "<DYNAMIC CALL> " : "") + m_procedure.FullName, "<arguments>"); m_loggerInside = m_loggerInsideScope; } else { m_loggerInsideScope = null; } }
public LoggerScope(ILoggerScope parent, object state) { Parent = parent; _stringifiedState = StringifyState(state); }
public void SetTaskLogger(ILoggerScope logger) { m_logger = logger; }
public TaskContextDummy(ILoggerScope logger = null) { Logger = logger; }
public CorrelationMiddleware(ILoggerScope loggerScope, CorrelationIdProvider correlationIdProvider, RequestDelegate next) { this._loggerScope = loggerScope; _correlationIdProvider = correlationIdProvider; this._next = next; }