public DefaultLogger(string name,
                             LoggerLevels levels,
                             LoggerFilter filter,
                             Target target,
                             ProfilerBuilder profiler)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }

            this.levels        = levels ?? LoggerLevels.All;
            this.filter        = filter ?? LoggerFilter.All;
            this.name          = name;
            this.target        = target;
            this.target.Logger = this;

            if (profiler == null || profiler.Enabled)
            {
                this.profiler = new DefaultProfiler(this);
            }
            else
            {
                this.profiler = Profiler.Null;
            }
        }
예제 #2
0
        public void Test_ProfilerBuilder_Creation_Null()
        {
            var builder = new ProfilerBuilder <ProfileCell>();

            builder.Configure(ProfileStyle.CellPasses, null, null, GridDataType.All, null, null, null, null, VolumeComputationType.None, null, null);

            Assert.True(builder != null, "Builder failed to construct");
        }
예제 #3
0
        public void Test_ProfilerBuilder_Creation_ProfileBuilders()
        {
            var builder = new ProfilerBuilder <ProfileCell>();

            builder.Configure(ProfileStyle.CellPasses, null, null, GridDataType.All, null, null, null, null, VolumeComputationType.None, null, null);

            Assert.True(builder.CellLiftBuilder == DIContext.Obtain <ICellLiftBuilder>(), "Cell lift builder not expected one");
            Assert.True(builder.CellProfileBuilder == DIContext.Obtain <ICellProfileBuilder <ProfileCell> >(),
                        "Cell profile builder not expected one");
            Assert.True(builder.CellProfileAnalyzer == DIContext.Obtain <ICellProfileAnalyzer <ProfileCell> >(),
                        "Profile lift builder not expected one");
        }