本文整理汇总了C#中ILogger.Info方法的典型用法代码示例。如果您正苦于以下问题:C# ILogger.Info方法的具体用法?C# ILogger.Info怎么用?C# ILogger.Info使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ILogger
的用法示例。
在下文中一共展示了ILogger.Info方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Process
public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
{
var nugetNamePattern = args.FirstOrDefault();
if (nugetNamePattern == null || nugetNamePattern.StartsWith("-") || nugetNamePattern.EndsWith("\"")) {
logger.Error("No nuget pattern specified");
return true;
}
var nugetComponent = components.FindComponent<INugetSpec>(nugetNamePattern);
if (nugetComponent == null)
return true;
logger.Info("== Nuget to add: {0}", nugetComponent);
var componentNamePattern = args.LastOrDefault();
if (componentNamePattern == null || componentNamePattern.StartsWith("-") || componentNamePattern.EndsWith("\"")) {
logger.Error("No component pattern specified");
return true;
}
var specificComponent = components.FindComponent<IProject>(componentNamePattern);
if (specificComponent == null)
return true;
logger.Info("== Component to reference nuget: {0}", specificComponent);
if (specificComponent == nugetComponent) {
logger.Error("Nuget can't be added to itself");
return true;
}
specificComponent.AddNuget(logger, nugetComponent, components, packagesOutputDirectory);
return true;
}
示例2: StartupController
public StartupController(IObjectProvider objectProvider, ILogger logger,
IApplicationStatePublisher applicationStatePublisher)
{
applicationStatePublisher.Publish(ApplicationState.Startup);
logger.Info($"Starting Tail Blazer version v{Assembly.GetEntryAssembly().GetName().Version}");
logger.Info($"at {DateTime.UtcNow}");
//run start up jobs
objectProvider.Get<FileHeaderNamingJob>();
objectProvider.Get<UhandledExceptionHandler>();
var settingsRegister = objectProvider.Get<ISettingsRegister>();
settingsRegister.Register(new GeneralOptionsConverter(), "GeneralOptions");
settingsRegister.Register(new RecentFilesToStateConverter(), "RecentFiles");
settingsRegister.Register(new StateBucketConverter(), "BucketOfState");
settingsRegister.Register(new RecentSearchToStateConverter(), "RecentSearch");
settingsRegister.Register(new TextAssociationToStateConverter(), "TextAssociation");
settingsRegister.Register(new SearchMetadataToStateConverter(), "GlobalSearch");
//TODO: Need type scanner then this code is not required
var viewFactoryRegister = objectProvider.Get<IViewFactoryRegister>();
viewFactoryRegister.Register<TailViewModelFactory>();
objectProvider.Get<SystemSetterJob>();
logger.Info("Starting complete");
}
示例3: Execute
public virtual void Execute(JobExecutionContext context)
{
Logger = new ServiceLogger(context.JobDetail.Name);
if (Monitor.TryEnter(SYNC_LOCK, 3000) == false)
{
Logger.Debug("上一次调度未完成,本次调度放弃运行");
return;
}
try
{
Logger.Info("调度开始执行");
InnerExecute(context);
Logger.Info("调度正常结束");
}
catch (Exception e)
{
Logger.Error("调度执行时发生异常: " + e);
}
finally
{
Monitor.Exit(SYNC_LOCK);
}
}
示例4: UpdateApplication
public void UpdateApplication(IApplicationPaths appPaths, string archive, ILogger logger, string restartServiceName)
{
// First see if there is a version file and read that in
var version = "Unknown";
if (File.Exists(archive + ".ver"))
{
version = File.ReadAllText(archive + ".ver");
}
// Use our installer passing it the specific archive
// We need to copy to a temp directory and execute it there
var source = Path.Combine(appPaths.ProgramSystemPath, UpdaterExe);
logger.Info("Copying updater to temporary location");
var tempUpdater = Path.Combine(Path.GetTempPath(), UpdaterExe);
File.Copy(source, tempUpdater, true);
source = Path.Combine(appPaths.ProgramSystemPath, UpdaterDll);
var tempUpdaterDll = Path.Combine(Path.GetTempPath(), UpdaterDll);
logger.Info("Copying updater dependencies to temporary location");
File.Copy(source, tempUpdaterDll, true);
var product = "mbt";
// Our updater needs SS and ionic
source = Path.Combine(appPaths.ProgramSystemPath, "ServiceStack.Text.dll");
File.Copy(source, Path.Combine(Path.GetTempPath(), "ServiceStack.Text.dll"), true);
source = Path.Combine(appPaths.ProgramSystemPath, "SharpCompress.dll");
File.Copy(source, Path.Combine(Path.GetTempPath(), "SharpCompress.dll"), true);
logger.Info("Starting updater process.");
Process.Start(tempUpdater, string.Format("product={0} archive=\"{1}\" caller={2} pismo=false version={3} service={4} installpath=\"{5}\"", product, archive, Process.GetCurrentProcess().Id, version, restartServiceName ?? string.Empty, appPaths.ProgramDataPath));
// That's it. The installer will do the work once we exit
}
示例5: PostImporter
public PostImporter()
{
_checkpoint = new FileCheckpoint("postsLoaded");
_logger = new EventStore.ClientAPI.Common.Log.ConsoleLogger();
var _connectionSettings =
ConnectionSettings.Create()
.UseConsoleLogger()
.KeepReconnecting()
.KeepRetrying()
.OnConnected(_ => _logger.Info("Event Store Connected"))
.OnDisconnected(_ => _logger.Error("Event Store Disconnected"))
.OnReconnecting(_ => _logger.Info("Event Store Reconnecting"))
.OnErrorOccurred((c, e) => _logger.Error(e, "Event Store Error :("));
_connection = EventStoreConnection.Create(_connectionSettings, new IPEndPoint(IPAddress.Parse("192.81.222.61"), 1113));
_connection.Connect();
ThreadPool.SetMaxThreads(20, 20);
ThreadPool.SetMinThreads(20, 20);
//ServicePointManager.DefaultConnectionLimit = 1000;
ServicePointManager.Expect100Continue = false;
ServicePointManager.ServerCertificateValidationCallback = Validator;
//ServicePointManager.EnableDnsRoundRobin = false;
//ServicePointManager.DnsRefreshTimeout = Int32.MaxValue;
}
示例6: GetFullNameFromPath
/// <summary>
/// Get the games full name from the zip file name. Ex: xmcota.zip will return "X-Men: Children of the Atom"
/// </summary>
/// <param name="path">The path</param>
/// <param name="logger"></param>
/// <returns>The games full name</returns>
public static string GetFullNameFromPath(string path, ILogger logger)
{
if (_romNamesDictionary == null)
{
lock (LockObject)
{
// Build the dictionary if it's not already populated
if (_romNamesDictionary == null)
{
logger.Info("GameBrowser: Initializing RomNamesDictionary");
_romNamesDictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
logger.Info("GameBrowser: Building RomNamesDictionary");
BuildRomNamesDictionary(logger);
}
}
}
var shortName = Path.GetFileNameWithoutExtension(path);
if (shortName != null)
{
string value;
if (_romNamesDictionary.TryGetValue(shortName, out value))
{
return value;
}
}
return null;
}
示例7: Start
/// <summary>
/// 开始监控文件夹
/// </summary>
public void Start()
{
log = LogManager.GetLogger("FileWatch.Start()");
log.Info("准备开始监控文件夹");
txtBox.AppendText("准备开始监控文件夹" + System.Environment.NewLine);
FileSystemWatcher watcher = new FileSystemWatcher();
string emfFilePath = string.Empty;
if (string.IsNullOrEmpty(emfFilePath))
{
emfFilePath = Path.Combine(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location), "test");
if (!Directory.Exists(emfFilePath))
{
Directory.CreateDirectory(emfFilePath);
}
else
{
Directory.GetFiles(emfFilePath).ToList().ForEach(c =>
{ if (c != null) File.Delete(c); });
}
}
log.Info("监控的文件夹为:" + emfFilePath);
txtBox.AppendText("监控的文件夹为:" + emfFilePath + System.Environment.NewLine);
watcher.Path = emfFilePath;
//监控文件的上次访问、上次写入、文件名、文件目录、文件大小;
watcher.NotifyFilter = NotifyFilters.LastAccess | NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName | NotifyFilters.Size;
//仅仅监控emf文件
watcher.Filter = "*.xml";
watcher.Created += new FileSystemEventHandler(watcher_Created);
watcher.Deleted += new FileSystemEventHandler(watcher_Deleted);
watcher.EnableRaisingEvents = true; //设置为true则触发删除和deleted事件;
}
示例8: MainManager
public MainManager(ILogger logger, LoopManager loopManager, DeviceManager deviceManager,
EffectManager effectManager, ProfileManager profileManager, PipeServer pipeServer)
{
Logger = logger;
LoopManager = loopManager;
DeviceManager = deviceManager;
EffectManager = effectManager;
ProfileManager = profileManager;
PipeServer = pipeServer;
_processTimer = new Timer(1000);
_processTimer.Elapsed += ScanProcesses;
_processTimer.Start();
ProgramEnabled = false;
Running = false;
// Create and start the web server
GameStateWebServer = new GameStateWebServer(logger);
GameStateWebServer.Start();
// Start the named pipe
PipeServer.Start("artemis");
// Start the update task
var updateTask = new Task(Updater.UpdateApp);
updateTask.Start();
Logger.Info("Intialized MainManager");
Logger.Info($"Artemis version {Assembly.GetExecutingAssembly().GetName().Version} is ready!");
}
示例9: Bootstrapper
public Bootstrapper()
{
Thread.CurrentThread.Name = "UI";
_loggerFactory = new LoggerFactory();
_logger = _loggerFactory.CreateLogger(GetType());
_logger.Info("-------------------------------------------------------------------------------");
_logger.Info("Starting application");
}
示例10: OnStart
protected override void OnStart(string[] args)
{
logger = LogManager.GetLogger("文件监控服务启动");
logger.Info("文件监控服务准备启动");
g_FilePathWatch = new FileWatch();
g_FilePathWatch.Start();
logger.Info("文件监控服务启动完毕");
// TODO: Add code here to start your service.
}
示例11: Startup
static Startup()
{
_logger = new Log4NetLogger(typeof(Startup));
_logger.Info("--------------------------------------------------------------------------------");
_logger.Info("--------------------------------------------------------------------------------");
_logger.Info("--------------------------------------------------------------------------------");
_logger.Info("Startup");
_container = Bootstrapper.Initialise();
}
示例12: Execute
public void Execute(ILogger logger)
{
logger.Info("AdoInspector: Starting to replace DbProviderFactory");
//This forces the creation
try
{
DbProviderFactories.GetFactory("Anything");
}
catch (ArgumentException ex)
{
}
//Find the registered providers
var table = Support.FindDbProviderFactoryTable();
//Run through and replace providers
foreach (var row in table.Rows.Cast<DataRow>().ToList())
{
DbProviderFactory factory;
try
{
factory = DbProviderFactories.GetFactory(row);
logger.Info("AdoInspector: Successfully retrieved factory - {0}", row["Name"]);
}
catch (Exception)
{
logger.Error("AdoInspector: Failed to retrieve factory - {0}", row["Name"]);
continue;
}
//Check that we haven't already wrapped things up
if (factory is GlimpseDbProviderFactory)
{
logger.Error("AdoInspector: Factory is already wrapped - {0}", row["Name"]);
continue;
}
var proxyType = typeof(GlimpseDbProviderFactory<>).MakeGenericType(factory.GetType());
var newRow = table.NewRow();
newRow["Name"] = row["Name"];
newRow["Description"] = row["Description"];
newRow["InvariantName"] = row["InvariantName"];
newRow["AssemblyQualifiedName"] = proxyType.AssemblyQualifiedName;
table.Rows.Remove(row);
table.Rows.Add(newRow);
logger.Info("AdoInspector: Successfully replaced - {0}", newRow["Name"]);
}
logger.Info("AdoInspector: Finished replacing DbProviderFactory");
}
示例13: AddFeatureIfNotAlreadyAdded
/// <summary>
/// Safely add new feature : AddFeatureIfNotAlreadyAdded
/// </summary>
/// <param name="logger">ILogger logger</param>
/// <param name="collection">SPFeatureCollection collection</param>
/// <param name="featureGuid">Guid featureGuid</param>
private void AddFeatureIfNotAlreadyAdded(ILogger logger, SPFeatureCollection collection, Guid featureGuid)
{
if (collection[featureGuid] == null)
{
logger.Info("Activating feature with Guid " + featureGuid.ToString());
collection.Add(featureGuid);
}
else
{
logger.Info("Skipping feature with Guid " + featureGuid.ToString());
}
}
开发者ID:GSoft-SharePoint,项目名称:Dynamite-2010-Components,代码行数:18,代码来源:Nav+Links+List+Instance.EventReceiver.cs
示例14: Service
public Service()
{
InitializeContainer();
m_logger = Log.For(this);
m_settings = new ServiceSettings();
m_logger.Info("Starting Service");
this.InitStore();
m_logger.Info("Service Started Successfully");
}
示例15: Process
public bool Process(ILogger logger, IEnumerable<string> args, MetaProjectPersistence metaProject, ComponentsList components, string packagesOutputDirectory)
{
logger.Info("Directories that will be scanned:");
using (logger.Block)
foreach (var dir in metaProject.ListOfDirectories)
logger.Info(dir);
logger.Info("Directories that won't be scanned:");
using (logger.Block)
foreach (var dir in metaProject.ListOfExcludedDirectories)
logger.Info(dir);
Rescan(logger, metaProject, components);
return true;
}