コード例 #1
0
 /// <summary>Clear any custom configurations to Redwood</summary>
 /// <returns>this</returns>
 public virtual Edu.Stanford.Nlp.Util.Logging.RedwoodConfiguration Clear()
 {
     this.tasks = new LinkedList <IRunnable>();
     this.tasks.Add(null);
     this.outputHandler = Redwood.ConsoleHandler.Out();
     return(this);
 }
コード例 #2
0
 /// <summary>Determine where, in the end, console output should go.</summary>
 /// <remarks>
 /// Determine where, in the end, console output should go.
 /// The default is stdout.
 /// </remarks>
 /// <param name="method">An output, one of: stdout, stderr, or java.util.logging</param>
 /// <returns>this</returns>
 public virtual Edu.Stanford.Nlp.Util.Logging.RedwoodConfiguration Output(string method)
 {
     if (Sharpen.Runtime.EqualsIgnoreCase(method, "stdout") || Sharpen.Runtime.EqualsIgnoreCase(method, "out"))
     {
         JavaUtilLoggingAdaptor.Adapt();
         this.outputHandler = Redwood.ConsoleHandler.Out();
     }
     else
     {
         if (Sharpen.Runtime.EqualsIgnoreCase(method, "stderr") || Sharpen.Runtime.EqualsIgnoreCase(method, "err"))
         {
             JavaUtilLoggingAdaptor.Adapt();
             this.outputHandler = Redwood.ConsoleHandler.Err();
         }
         else
         {
             if (Sharpen.Runtime.EqualsIgnoreCase(method, "java.util.logging"))
             {
                 JavaUtilLoggingAdaptor.Adapt();
                 this.outputHandler = RedirectOutputHandler.FromJavaUtilLogging(Logger.GetLogger("``error``"));
             }
             else
             {
                 throw new ArgumentException("Unknown value for log.method");
             }
         }
     }
     return(this);
 }