本文整理汇总了C#中ILogProvider类的典型用法代码示例。如果您正苦于以下问题:C# ILogProvider类的具体用法?C# ILogProvider怎么用?C# ILogProvider使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ILogProvider类属于命名空间,在下文中一共展示了ILogProvider类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CommonScriptEngine
protected CommonScriptEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
{
Guard.AgainstNullArgument("logProvider", logProvider);
ScriptOptions = new ScriptOptions().WithReferences(typeof(Object).Assembly);
_scriptHostFactory = scriptHostFactory;
_log = logProvider.ForCurrentType();
}
示例2: ExecuteReplCommand
public ExecuteReplCommand(
string scriptName,
string[] scriptArgs,
IFileSystem fileSystem,
IScriptPackResolver scriptPackResolver,
IRepl repl,
ILogProvider logProvider,
IConsole console,
IAssemblyResolver assemblyResolver,
IFileSystemMigrator fileSystemMigrator,
IScriptLibraryComposer composer)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("scriptPackResolver", scriptPackResolver);
Guard.AgainstNullArgument("repl", repl);
Guard.AgainstNullArgument("logProvider", logProvider);
Guard.AgainstNullArgument("console", console);
Guard.AgainstNullArgument("assemblyResolver", assemblyResolver);
Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
Guard.AgainstNullArgument("composer", composer);
_scriptName = scriptName;
_scriptArgs = scriptArgs;
_fileSystem = fileSystem;
_scriptPackResolver = scriptPackResolver;
_repl = repl;
_logger = logProvider.ForCurrentType();
_console = console;
_assemblyResolver = assemblyResolver;
_fileSystemMigrator = fileSystemMigrator;
_composer = composer;
}
示例3: ApplicationInitialization
public ApplicationInitialization(
ILogProvider logProvider,
IPluginsContainer<IServerInitializer> initializersContainer)
{
_deployPackagesLogger = logProvider.GetLogger("DeployPackages");
_initializersContainer = initializersContainer;
}
示例4: DslModel
public DslModel(IDslParser dslParser, ILogProvider logProvider)
{
_dslParser = dslParser;
_performanceLogger = logProvider.GetLogger("Performance");
_logger = logProvider.GetLogger("DslModel");
_dslContainer = new DslContainer(logProvider);
}
示例5: ScriptExecutor
public ScriptExecutor(
IFileSystem fileSystem,
IFilePreProcessor filePreProcessor,
IScriptEngine scriptEngine,
ILogProvider logProvider,
IScriptLibraryComposer composer)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgumentProperty("fileSystem", "BinFolder", fileSystem.BinFolder);
Guard.AgainstNullArgumentProperty("fileSystem", "DllCacheFolder", fileSystem.DllCacheFolder);
Guard.AgainstNullArgument("filePreProcessor", filePreProcessor);
Guard.AgainstNullArgument("scriptEngine", scriptEngine);
Guard.AgainstNullArgument("logProvider", logProvider);
Guard.AgainstNullArgument("composer", composer);
References = new AssemblyReferences(DefaultReferences);
Namespaces = new Collection<string>();
ImportNamespaces(DefaultNamespaces);
FileSystem = fileSystem;
FilePreProcessor = filePreProcessor;
ScriptEngine = scriptEngine;
_log = logProvider.ForCurrentType();
#pragma warning disable 618
Logger = new ScriptCsLogger(_log);
#pragma warning restore 618
ScriptLibraryComposer = composer;
}
示例6: CompileOnlyOptionFilePreProcessor
public CompileOnlyOptionFilePreProcessor(
IFileSystem fileSystem,
ILogProvider logProvider,
IEnumerable<ILineProcessor> lineProcessors)
: base(fileSystem, logProvider, lineProcessors)
{
}
开发者ID:vladislav-karamfilov,项目名称:scriptcs-compile-only-option,代码行数:7,代码来源:CompileOnlyOptionFilePreProcessor.cs
示例7: ModuleLoader
public ModuleLoader(IAssemblyResolver resolver, ILogProvider logProvider, Action<Assembly, AggregateCatalog> addToCatalog, Func<CompositionContainer, IEnumerable<Lazy<IModule, IModuleMetadata>>> getLazyModules, IFileSystem fileSystem, IAssemblyUtility assemblyUtility)
{
Guard.AgainstNullArgument("logProvider", logProvider);
_resolver = resolver;
_logger = logProvider.ForCurrentType();
if (addToCatalog == null)
{
addToCatalog = (assembly, catalog) =>
{
try
{
var assemblyCatalog = new AssemblyCatalog(assembly);
catalog.Catalogs.Add(assemblyCatalog);
}
catch (Exception exception)
{
_logger.DebugFormat("Module Loader exception: {0}", exception.Message);
}
};
}
_addToCatalog = addToCatalog;
if (getLazyModules == null)
{
getLazyModules = container => container.GetExports<IModule, IModuleMetadata>();
}
_getLazyModules = getLazyModules;
_fileSystem = fileSystem;
_assemblyUtility = assemblyUtility;
}
示例8: Proxy
public Proxy(ILogProvider logProvider, ProxySettings settings)
{
LogProvider = logProvider;
Settings = settings;
LocalReader = new PacketReader(PacketContext.ClientToServer);
RemoteReader = new PacketReader(PacketContext.ServerToClient);
}
示例9: DesktopMonitorBaseViewModel
protected DesktopMonitorBaseViewModel(ILogProvider logProvider)
{
if (!IsInDesignMode)
{
Log = logProvider.GetLogger(GetType());
}
}
示例10: DslParser
public DslParser(IDslSource dslSource, IConceptInfo[] conceptInfoPlugins, ILogProvider logProvider)
{
_dslSource = dslSource;
_conceptInfoPlugins = conceptInfoPlugins;
_performanceLogger = logProvider.GetLogger("Performance");
_logger = logProvider.GetLogger("DslParser");
}
示例11: WatchScriptCommand
public WatchScriptCommand(
Config config,
string[] scriptArgs,
IConsole console,
IFileSystem fileSystem,
ILogProvider logProvider,
IFileSystemMigrator fileSystemMigrator)
{
Guard.AgainstNullArgument("config", config);
Guard.AgainstNullArgument("scriptArgs", scriptArgs);
Guard.AgainstNullArgument("console", console);
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("logProvider", logProvider);
Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
_config = config;
_scriptArgs = scriptArgs;
_console = console;
_fileSystem = fileSystem;
_logger = logProvider.ForCurrentType();
_fileSystemMigrator = fileSystemMigrator;
_executeScriptCommand = new CrossAppDomainExecuteScriptCommand
{
Config = _config,
ScriptArgs = _scriptArgs,
};
}
示例12: RoslynScriptInMemoryEngine
public RoslynScriptInMemoryEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
: base(scriptHostFactory, logProvider)
{
Guard.AgainstNullArgument("logProvider", logProvider);
_log = logProvider.ForCurrentType();
}
示例13: StoreController
//private readonly ILog _log;
public StoreController(IGenreRepository genres, IAlbumsRepository albums, ILogProvider log)
{
_genres = genres;
_albums = albums;
_log = log;
//_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
}
示例14: AppDomainAssemblyResolver
public AppDomainAssemblyResolver(
ILogProvider logProvider,
IFileSystem fileSystem,
IAssemblyResolver resolver,
IAssemblyUtility assemblyUtility,
IDictionary<string, AssemblyInfo> assemblyInfoMap = null,
Func<object, ResolveEventArgs, Assembly> resolveHandler = null)
{
Guard.AgainstNullArgument("logProvider", logProvider);
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("resolver", resolver);
Guard.AgainstNullArgument("assemblyUtility", assemblyUtility);
_assemblyInfoMap = assemblyInfoMap ?? new Dictionary<string, AssemblyInfo>();
_assemblyUtility = assemblyUtility;
_logger = logProvider.ForCurrentType();
_fileSystem = fileSystem;
_resolver = resolver;
if (resolveHandler == null)
{
resolveHandler = AssemblyResolve;
}
AppDomain.CurrentDomain.AssemblyResolve += new ResolveEventHandler(resolveHandler);
}
示例15: AuthenticationService
public AuthenticationService(
ILogProvider logProvider,
Lazy<IAuthorizationManager> authorizationManager,
Lazy<IQueryableRepository<IPasswordStrength>> passwordStrengthRules,
Lazy<IQueryableRepository<IPasswordAttemptsLimit>> passwordAttemptsLimitRepository,
Lazy<ISqlExecuter> sqlExecuter,
Lazy<IEnumerable<ISendPasswordResetToken>> sendPasswordResetTokenPlugins)
{
_logger = logProvider.GetLogger("AspNetFormsAuth.AuthenticationService");
_authorizationManager = authorizationManager;
_sqlExecuter = sqlExecuter;
_sendPasswordResetTokenPlugin = new Lazy<ISendPasswordResetToken>(() => SinglePlugin(sendPasswordResetTokenPlugins));
_passwordStrengthRules = passwordStrengthRules;
_passwordAttemptsLimits = new Lazy<IList<PasswordAttemptsLimit>>(
() =>
{
var limits = passwordAttemptsLimitRepository.Value.Query()
.Select(l => new PasswordAttemptsLimit { MaxInvalidPasswordAttempts = l.MaxInvalidPasswordAttempts, TimeoutInSeconds = l.TimeoutInSeconds })
.ToList();
foreach (var limit in limits)
if (limit.TimeoutInSeconds == null || limit.TimeoutInSeconds <= 0)
limit.TimeoutInSeconds = int.MaxValue;
return limits;
});
}