/// <summary> /// Initializes a new instance of the <see cref="Logger"/> class. /// </summary> /// <param name="loggingSink"> /// The logging sink. /// </param> public Logger(ILoggingSink loggingSink) { Contract.Requires(loggingSink != null); Contract.Ensures(this.loggingSink == loggingSink); this.loggingSink = loggingSink; }
/// <summary> /// Initializes a new instance of the <see cref="Logger"/> class. /// </summary> /// <param name="loggingSink"> /// The logging sink. /// </param> public Logger(ILoggingSink loggingSink) { this.loggingSink = loggingSink; if (loggingSink == null) { throw new ArgumentNullException("loggingSink"); } }
public void AddGuiAppender( ILoggingSink sink ) { var appender = new LoggingSinkAppender( sink ); appender.Layout = new ConsoleLoggingLayout(); appender.Name = "GuiAppender"; appender.AddFilter( new LevelRangeFilter() { LevelMin = LogManager.GetRepository().Threshold, LevelMax = Level.Fatal } ); appender.AddFilter( new DenyAllFilter() ); appender.ActivateOptions(); BasicConfigurator.Configure( appender ); }
public static Logger Create(ILoggingSink loggingSink_iLoggingSink) { Logger logger = PexInvariant.CreateInstance<Logger>(); PexInvariant.SetField (logger, "loggingSink", loggingSink_iLoggingSink); PexInvariant.CheckInvariant(logger); return logger; // TODO: Edit factory method of Logger // This method should be able to configure the object in all possible ways. // Add as many parameters as needed, // and assign their values to each field by using the API. }
public void AddGuiAppender(ILoggingSink sink) { var appender = new LoggingSinkAppender(sink); appender.Layout = new ConsoleLoggingLayout(); appender.Name = "GuiAppender"; appender.AddFilter(new LevelRangeFilter() { LevelMin = LogManager.GetRepository().Threshold, LevelMax = Level.Fatal }); appender.AddFilter(new DenyAllFilter()); appender.ActivateOptions(); BasicConfigurator.Configure(appender); }
public static SLogger Create( ILoggingSink loggingSink_iLoggingSink, bool __callBase_b, IBehavior __instanceBehavior_iBehavior ) { SLogger sLogger = PexInvariant.CreateInstance<SLogger>(); PexInvariant.SetField (sLogger, "loggingSink", loggingSink_iLoggingSink); PexInvariant.SetField(sLogger, "__callBase", __callBase_b); PexInvariant.SetField (sLogger, "__instanceBehavior", __instanceBehavior_iBehavior); PexInvariant.CheckInvariant(sLogger); return sLogger; // TODO: Edit factory method of SLogger // This method should be able to configure the object in all possible ways. // Add as many parameters as needed, // and assign their values to each field by using the API. }
public DefaultLogger(ILoggingSink sink) { Contract.RequiresNotNull(sink, "sink"); mySink = sink; }
public LoggingSinkAppender( ILoggingSink sink ) { mySink = sink; }
public LoggingSinkAppender(ILoggingSink sink) { mySink = sink; }
public void AddSink(ILoggingSink sink) { myRootSink.Add(sink); }
public static void AddSink(ILoggingSink sink) { Implementation.AddSink(sink); }
public Logger(ILoggingSink loggingSink) { _loggingSink = loggingSink; }
public void AddGuiAppender( ILoggingSink sink ) { myRootSink.Add( sink ); }
public Logger(ILoggingSink loggingSink) { _loggingSink = loggingSink; }
public void Add(ILoggingSink sink) { Contract.RequiresNotNull(sink, "sink"); mySinks.Add(sink); }
public LoggingSinkLogger( ILoggingSink sink ) { Contract.RequiresNotNull( sink, "sink" ); mySink = sink; }
public void Remove(ILoggingSink sink) { Contract.RequiresNotNull(sink, "sink"); mySinks.Remove(sink); }
public static void AddGuiAppender( ILoggingSink sink ) { Implementation.AddGuiAppender( sink ); }
public void AddGuiAppender( ILoggingSink sink ) { // nothing to do -> ignore this call }