internal static BaseLogger CreateInstance(LogElement logElement) { if (_instance == null) { Type providerType = Type.GetType(logElement.ProviderType); if (providerType == null) throw new InvalidConfigurationException("Could not locate Log Provider :" + logElement.ProviderType); if (!providerType.ImplementsClass<BaseLogger>()) throw new InvalidConfigurationException("Log Provider does not implement ILogger:" + logElement.ProviderType); var args = new CommandArgs(logElement.Parameters); _instance = (BaseLogger) Activator.CreateInstance(providerType, args); } return _instance; }
public static IContext CreateDefault(BaseLogger baseLogger, IArguments arguments, BaseCacheStore cacheStore) { return _defaultContext ?? (_defaultContext = new CurrentContext(baseLogger, arguments, cacheStore)); }
private CurrentContext(BaseLogger baseLogger, IArguments arguments, BaseCacheStore cacheStore) { Log = baseLogger; ApplicationParams = arguments; Cache = cacheStore; }