Example #1
0
        public static TaskRunnerActivity BeginActivity(this ILogger self, string type, string name)
        {
            var activity = new TaskRunnerActivity(type, name);
            var scope    = self.BeginScopeImpl(activity);

            activity.AttachToScope(scope);
            return(activity);
        }
            private void LogEndAction(TaskRunnerActivity action)
            {
                var message = action.Name;

                if (!string.IsNullOrEmpty(action.Conclusion))
                {
                    message = $"{message} {action.Conclusion}";
                }
                var categoryColor = action.Success ? ConsoleColor.Green : ConsoleColor.Red;
                var messageColor  = action.Success ? ConsoleColor.White : ConsoleColor.Red;

                LogCore(action.Type, action.Success ? "OK" : "FAIL", message, categoryColor, messageColor, start: false);
            }
 private void LogStartAction(TaskRunnerActivity action)
 {
     LogCore(action.Type, string.Empty, action.Name, categoryColor: ConsoleColor.Green, messageColor: ConsoleColor.White, start: true);
 }