本文整理汇总了C#中ILogManager.Trace方法的典型用法代码示例。如果您正苦于以下问题:C# ILogManager.Trace方法的具体用法?C# ILogManager.Trace怎么用?C# ILogManager.Trace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogManager
的用法示例。
在下文中一共展示了ILogManager.Trace方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EntityExtension
public EntityExtension( string name, ISystem system, ILogManager logManager )
{
if ( logManager == null )
{
throw new ArgumentNullException( "logManager", "The log manager must not be null." );
}
if ( String.IsNullOrEmpty( name ) )
{
string message = "The given extension name must not be empty or null.";
ArgumentException argEx = new ArgumentException( message, "name" );
logManager.Trace( Namespace.LoggerName, LogLevel.Error, argEx, message );
throw argEx;
}
this.Name = name;
this.System = system;
this.LogManager = logManager;
// register system events
this.System.TaskStarted += new TaskStateChangedDelegate( this.System_TaskStarted );
this.System.TaskEnded += new TaskStateChangedDelegate( this.System_TaskEnded );
}
示例2: ConfigureServices
/// <summary>
/// Retrieves all types marked as service and registers them with the builder.
/// </summary>
/// <param name="builder">The autofac builder to register the services with.</param>
/// <param name="pluginManager">The plugin manager to retrieve the service plugin details from.</param>
private void ConfigureServices( ContainerBuilder builder, IPluginManager pluginManager, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Information, "Configuring services..." );
foreach ( Attribute att in pluginManager.GetPluginsForType( typeof( ServiceAttribute ) ) )
{
ServiceAttribute serviceAtt = att as ServiceAttribute;
Type instanceType, interfaceType;
instanceType = serviceAtt.InstanceType;
interfaceType = ( serviceAtt.InterfaceType == null ) ? serviceAtt.InstanceType : serviceAtt.InterfaceType;
if ( serviceAtt.AsSingleton )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering service {0} as {1}. Scope: {2}", instanceType.FullName, interfaceType.FullName, "Singleton" );
builder.Register( instanceType ).As( interfaceType ).SingletonScoped();
}
else
{
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering service {0} as {1}. Scope: {2}", instanceType.FullName, interfaceType.FullName, "Factory" );
builder.Register( instanceType ).As( interfaceType ).FactoryScoped();
}
}
}
示例3: ConfigureEntityExtensions
private void ConfigureEntityExtensions( ContainerBuilder builder, IPluginManager pluginManager, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Information, "Configuring entity extensions..." );
try
{
IEnumerable<Attribute> plugins = pluginManager.GetPluginsForType( typeof( EntityExtensionAttribute ) );
foreach ( Attribute att in plugins )
{
EntityExtensionAttribute extAtt = att as EntityExtensionAttribute;
Type instanceType, interfaceType;
instanceType = extAtt.EntityExtensionType;
interfaceType = ( extAtt.InterfaceType == null ) ? extAtt.EntityExtensionType : extAtt.InterfaceType;
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering entity extension {0} as {1}.", instanceType.FullName, interfaceType.FullName );
builder.Register( instanceType ).As( interfaceType).FactoryScoped();
}
}
catch ( NGin.Core.Exceptions.PluginNotFoundException )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Error, "No entity extensions registerred." );
}
}
示例4: ConfigureSystems
private void ConfigureSystems( ContainerBuilder builder, IPluginManager pluginManager, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Information, "Configuring systems..." );
foreach ( Attribute att in pluginManager.GetPluginsForType( typeof( SystemAttribute ) ) )
{
SystemAttribute systemAtt = att as SystemAttribute;
Type instanceType, interfaceType;
instanceType = systemAtt.SystemType;
interfaceType = ( systemAtt.InterfaceType == null ) ? systemAtt.SystemType : systemAtt.InterfaceType;
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering system {0} as {1}.", instanceType.FullName, interfaceType.FullName );
builder.Register( instanceType ).As( interfaceType ).SingletonScoped();
}
}
示例5: ConfigurePluginManager
private void ConfigurePluginManager( ContainerBuilder builder, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering service {0} as {1}. Scope: {2}", typeof( PluginManager ).FullName, typeof( IPluginManager ).FullName, "Singleton" );
builder.Register<IPluginManager>( context =>
{
PluginsConfigXml pluginsConfig = this.ModuleConfig.GetSectionDataAs<PluginsConfigXml>( GlobalConstants.XmlConfiguration.SectionNames.PluginsSection );
ILogManager lm = context.Resolve<ILogManager>();
return new PluginManager( lm, pluginsConfig );
}
).SingletonScoped();
}
示例6: ConfigureDependencyResolver
private void ConfigureDependencyResolver( ContainerBuilder builder, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering service {0} as {1}. Scope: {2}", typeof(DependencyResolver).FullName, typeof(IDependencyResolver).FullName, "Singleton" );
builder.Register<IDependencyResolver>( context =>
{
INGinConfig coreConfig = context.Resolve<INGinConfig>();
return coreConfig.DependencyResolver;
}
).SingletonScoped();
}
示例7: ConfigureConfigManager
private void ConfigureConfigManager( ContainerBuilder builder, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Debugging, "Registering service {0} as {1}. Scope: {2}", typeof( ConfigManager ).FullName, typeof( IConfigManager ).FullName, "Singleton" );
builder.Register<ConfigManager>().As<IConfigManager>().SingletonScoped();
}
示例8: ConfigureScenes
private void ConfigureScenes( ContainerBuilder builder, IPluginManager pluginManager, ILogManager logManager )
{
logManager.Trace( Namespace.LoggerName, LogLevel.Information, "Configuring scenes..." );
builder.Register<IScene>( ( context ) =>
{
ISceneManager sceneManager = context.Resolve<ISceneManager>();
return sceneManager.CreateAndAddScene();
} );
}
示例9: MainLoopManager
public MainLoopManager( IStateManager stateManager, ILogManager logManager )
{
if(logManager == null)
{
throw new ArgumentNullException( "logManager" );
}
if ( stateManager == null )
{
ArgumentNullException argnEx = new ArgumentNullException( "stateManager" );
logManager.Trace( Namespace.LoggerName, LogLevel.Fatal, argnEx, argnEx.Message );
throw argnEx;
}
this.LogManager = logManager;
this.StateManager = stateManager;
this.heartbeatBuffer = new long[ this.bufferMaximum + 1 ];
this.currentBufferIndex = 0;
this.HeartbeatEnded += new HeartbeatDelegate( this.MainLoopManager_HeartbeatEnded );
}
示例10: StateManager
internal StateManager( ILogManager logManager, IPluginManager pluginManager, IMachine stateMachine, INGinCore core )
{
if ( logManager == null )
{
string message = "The log manager must not be null.";
ArgumentNullException argnEx = new ArgumentNullException( "logManager", message );
throw argnEx;
}
if ( pluginManager == null )
{
string message = "The plugin manager must not be null.";
ArgumentNullException argnEx = new ArgumentNullException( "pluginManager", message );
logManager.Trace( Namespace.LoggerName, LogLevel.Error, argnEx, message );
throw argnEx;
}
if ( stateMachine == null )
{
string message = "The state machine must not be null.";
ArgumentNullException argnEx = new ArgumentNullException( "stateMachine", message );
logManager.Trace( Namespace.LoggerName, LogLevel.Error, argnEx, message );
throw argnEx;
}
if ( core == null )
{
string message = "The core must not be null.";
ArgumentNullException argnEx = new ArgumentNullException( "core", message );
logManager.Trace( Namespace.LoggerName, LogLevel.Error, argnEx, message );
throw argnEx;
}
this.LogManager = logManager;
this.PluginManager = pluginManager;
this.StateMachine = stateMachine;
this.Core = core;
this.Core.RunStarted += new CoreStateDelegate( this.Core_RunStarted );
this.Core.RunStopped += new CoreStateDelegate( this.Core_RunStopped );
}