public SlackReporter(ReportLevelType reportLevel,
                             String webhookURL,
                             String userName,
                             String channelDebug,
                             String channelInfo,
                             String channelWarn,
                             String channelError,
                             String channelFatal,
                             String iconEmoji          = null,
                             Int32 addUTCHour          = 0,
                             Boolean tryOrderingReport = false)
            : base(ReporterType.Slack, reportLevel)
        {
            if (String.IsNullOrEmpty(webhookURL))
            {
                _slackWebhook = null;
            }
            else
            {
                _channelDebug = channelDebug;
                _channelInfo  = channelInfo;
                _channelWarn  = channelWarn;
                _channelError = channelError;
                _channelFatal = channelFatal;

                _slackWebhook = new SlackWebhook(webhookURL, _channelDebug, userName, iconEmoji, addUTCHour);

                _tryOrderingReport = tryOrderingReport;

                if (_tryOrderingReport)
                {
                    _thread        = new NaiveLoopThread(SendReportInQueue, THREAD_INTERVAL_MS, null, nameof(SlackReporter));
                    _reportActions = new QueueMT <Action>();
                    _thread.Start();
                }
                else
                {
                    _thread        = null;
                    _reportActions = null;
                }
            }
        }
Exemple #2
0
 public DebugReporter(ReportLevelType reportLevel)
     : base(ReporterType.Debug, reportLevel)
 {
 }
 public ConsoleReporter(ReportLevelType reportLevel)
     : base(ReporterType.Console, reportLevel)
 {
 }
Exemple #4
0
 protected Reporter(ReporterType reporterType, ReportLevelType reportLevel)
 {
     ReporterType = reporterType;
     ReportLevel  = reportLevel;
 }
 public SilenceReporter(ReportLevelType reportLevel)
     : base(ReporterType.None, reportLevel)
 {
 }