Ejemplo n.º 1
0
 public static void Configure <T>()
 {
     Configuration = new ConfigurationBuilder()
                     .SetBasePath(Path.GetDirectoryName(typeof(Startup).Assembly.Location))
                     .AddJsonFile("appsettings.json", false)
                     .Build();
     Configuration.GetSection(typeof(T).Name).Bind(Settings = new Settings());
     Logger = LibLogFactory.FromConfiguration(Configuration);
     LibLogFactory.LoggerFor("Startup").Debug($"Console appsettings requested Setting {Settings.SomeSetting}, and requested logging with provider {LibLogFactory.Instance.Provider} at level {LibLogFactory.Instance.LogLevel}");
 }
        public void CanBeCreatedWithoutCommandLine()
        {
            var component =
                new Component.With.LibLog
                .AComponent(
                    LibLogFactory.LoggerFor <AComponent>(),
                    new Settings());

            component.AnAction("something").ShouldNotBeNull();
        }
Ejemplo n.º 3
0
 public static ILog CreateLogger <T>()
 {
     return(LibLogFactory.LoggerFor <T>());
 }