예제 #1
0
 public void R(string text, VerbositySettings verbosity = Moderate,
               [CallerFilePath] string path             = "", [CallerMemberName] string caller = "",
               [CallerLineNumber] int line = 0)
 {
     if (verbosity <= Verbosity)                                                                           // Only write if verbosity is below threshold.
     {
         var strippedText    = Regex.Replace(text, @"\n", "");                                             // Strip out any new lines.
         var message         = new Message("(Reporter):", DateTime.Now, strippedText, path, caller, line); // Construct message.
         int newMessageIndex = Report.Messages.Count;                                                      // New message index will equal count.
         Report.AddMessage(message);
         ReportWriter.WriteMessage(newMessageIndex);
     }
 }
예제 #2
0
        /// <summary>Initialize AppReporter as set to write to console and file.</summary>
        public Reporter(IO.FConsole writer, VerbositySettings verbosity = VerbositySettings.Moderate, [CallerFilePath] string path = "",
                        [CallerMemberName] string caller = "", [CallerLineNumber] int line = 0)
        {
            Output       = new OutputSettings();
            Output      |= (OutputSettings.Console | OutputSettings.File);
            Verbosity    = verbosity;
            StartTime    = DateTime.Now;
            _Report      = new Report(StartTime);
            ReportWriter = new ReportWriter(this, writer);

            // var initMessage = new Message(StartTime, initMsg, path, caller, line);            // Write initial message.
            // Report.AddMessage(initMessage);
            // ReportWriter.WriteMessage(0);
            // Write initial message (Program started, etc.)
        }
예제 #3
0
 public static void R(string s, VerbositySettings verbosity = VerbositySettings.Moderate)
 => T.Reporter.R(s, verbosity);