예제 #1
0
파일: Program.cs 프로젝트: RoydeM/Belatrix
        public static void Main(string[] args)
        {
            //			// TODO: JobLogger instantiation must be done by IOC.
            //			IKernel kernel = new StandardKernel(new IocModule());
            //			JobLogger sample = kernel.Get<JobLogger> ();
            ILogger[] loggers = new ILogger[] {
                new ConsoleLogger(),
                new SqlLogger(),
                new FileLogger()
            };
            JobLogger sample = new JobLogger(loggers);

            sample.LogMessage ("This is a sample warning message.", LogMessageLevel.Warning);
            sample.LogMessage ("Error! Just kidding! It's a sample too.", LogMessageLevel.Error);
        }
예제 #2
0
파일: Test.cs 프로젝트: RoydeM/Belatrix
        public void Setup()
        {
            consoleLogger = new Mock<ILogger> ();
            consoleLogger.Setup(c => c.GetOutputType()).Returns(LogOutputType.Console);

            sqlLogger = new Mock<ILogger> ();
            sqlLogger.Setup(s => s.GetOutputType()).Returns(LogOutputType.Database);

            fileLogger = new Mock<ILogger> ();
            fileLogger.Setup(f => f.GetOutputType()).Returns(LogOutputType.File);

            ILogger[] loggers = new ILogger[] {
                consoleLogger.Object,
                sqlLogger.Object,
                fileLogger.Object
            };
            logger = new JobLogger(loggers);
        }