예제 #1
0
 public static void Initialize()
 {
     if (_loggerFactory != null)
     {
         _loggerFactory.Initialize();
     }
 }
예제 #2
0
 public void BuildUp(IBuilderContext context)
 {
     if (context.Existing == null)
     {
         ILog log = LogFactory.Initialize(LogType);
         context.Existing = log;
     }
 }
예제 #3
0
 public static ILog Create(Type declaringType)
 {
     if (declaringType == null)
     {
         throw new ArgumentNullException("The argument cannot be null", "declaringType");
     }
     if (factory == null)
     {
         try {
             factory = Factory.Get <ILogFactory>();
             factory.Initialize();
         }
         catch { }
     }
     return(factory == null
         ? new WrapLog(declaringType)
         : factory.Create(declaringType));
 }
예제 #4
0
 public static ILog Create(string loggerName)
 {
     if (string.IsNullOrWhiteSpace(loggerName))
     {
         throw new ArgumentNullException($"The argument cannot be null", nameof(loggerName));
     }
     if (factory == null)
     {
         try
         {
             factory = Factory.Get <ILogFactory>();
             factory.Initialize();
         }
         catch { }
     }
     return(factory == null
                         ? new WrapLog(loggerName)
                         : factory.Create(loggerName));
 }