本文整理汇总了C#中ILogProvider.ForCurrentType方法的典型用法代码示例。如果您正苦于以下问题:C# ILogProvider.ForCurrentType方法的具体用法?C# ILogProvider.ForCurrentType怎么用?C# ILogProvider.ForCurrentType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogProvider
的用法示例。
在下文中一共展示了ILogProvider.ForCurrentType方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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;
}
示例2: CommonScriptEngine
protected CommonScriptEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
{
Guard.AgainstNullArgument("logProvider", logProvider);
ScriptOptions = new ScriptOptions().WithReferences(typeof(Object).Assembly);
_scriptHostFactory = scriptHostFactory;
_log = logProvider.ForCurrentType();
}
示例3: 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;
}
示例4: 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,
};
}
示例5: ExecuteScriptCommand
public ExecuteScriptCommand(
string script,
string[] scriptArgs,
IFileSystem fileSystem,
IScriptExecutor scriptExecutor,
IScriptPackResolver scriptPackResolver,
ILogProvider logProvider,
IAssemblyResolver assemblyResolver,
IFileSystemMigrator fileSystemMigrator,
IScriptLibraryComposer composer
)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("scriptExecutor", scriptExecutor);
Guard.AgainstNullArgument("scriptPackResolver", scriptPackResolver);
Guard.AgainstNullArgument("logProvider", logProvider);
Guard.AgainstNullArgument("assemblyResolver", assemblyResolver);
Guard.AgainstNullArgument("fileSystemMigrator", fileSystemMigrator);
Guard.AgainstNullArgument("composer", composer);
_script = script;
ScriptArgs = scriptArgs;
_fileSystem = fileSystem;
_scriptExecutor = scriptExecutor;
_scriptPackResolver = scriptPackResolver;
_logger = logProvider.ForCurrentType();
_assemblyResolver = assemblyResolver;
_fileSystemMigrator = fileSystemMigrator;
_composer = composer;
}
示例6: FileSystemMigrator
public FileSystemMigrator(IFileSystem fileSystem, ILogProvider logProvider)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("logProvider", logProvider);
_fileSystem = fileSystem;
_logger = logProvider.ForCurrentType();
_fileCopies = new Dictionary<string, string>
{
{ "packages.config", _fileSystem.PackagesFile },
{ "nuget.config", _fileSystem.NugetFile },
};
_directoryMoves = new Dictionary<string, string>
{
{ ".cache", _fileSystem.DllCacheFolder },
};
_directoryCopies = new Dictionary<string, string>
{
{ "bin", _fileSystem.BinFolder },
{ "packages", _fileSystem.PackagesFolder },
};
}
示例7: RoslynScriptInMemoryEngine
public RoslynScriptInMemoryEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
: base(scriptHostFactory, logProvider)
{
Guard.AgainstNullArgument("logProvider", logProvider);
_log = logProvider.ForCurrentType();
}
示例8: 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);
}
示例9: CSharpPersistentEngine
public CSharpPersistentEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider, IFileSystem fileSystem)
: base(scriptHostFactory, logProvider)
{
Guard.AgainstNullArgument("logProvider", logProvider);
_log = logProvider.ForCurrentType();
_fileSystem = fileSystem;
}
示例10: PackageContainer
public PackageContainer(IFileSystem fileSystem, ILogProvider logProvider)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("logProvider", logProvider);
_fileSystem = fileSystem;
_logger = logProvider.ForCurrentType();
}
示例11: RoslynScriptCompilerEngine
protected RoslynScriptCompilerEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
: base(scriptHostFactory, logProvider)
{
Guard.AgainstNullArgument("logProvider", logProvider);
_log = logProvider.ForCurrentType();
}
示例12: NugetInstallationProvider
public NugetInstallationProvider(IFileSystem fileSystem, ILogProvider logProvider)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("logProvider", logProvider);
_fileSystem = fileSystem;
_logger = logProvider.ForCurrentType();
}
示例13: PackageInstaller
public PackageInstaller(IInstallationProvider installer, ILogProvider logProvider)
{
Guard.AgainstNullArgument("installer", installer);
Guard.AgainstNullArgument("logProvider", logProvider);
_installer = installer;
_logger = logProvider.ForCurrentType();
}
示例14: FilePreProcessor
public FilePreProcessor(IFileSystem fileSystem, ILogProvider logProvider, IEnumerable<ILineProcessor> lineProcessors)
{
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("logProvider", logProvider);
_fileSystem = fileSystem;
_logger = logProvider.ForCurrentType();
_lineProcessors = lineProcessors;
}
示例15: SaveCommand
public SaveCommand(IPackageAssemblyResolver packageAssemblyResolver, IFileSystem fileSystem, ILogProvider logProvider)
{
Guard.AgainstNullArgument("packageAssemblyResolver", packageAssemblyResolver);
Guard.AgainstNullArgument("fileSystem", fileSystem);
Guard.AgainstNullArgument("logProvider", logProvider);
_packageAssemblyResolver = packageAssemblyResolver;
_fileSystem = fileSystem;
_logger = logProvider.ForCurrentType();
}