mirror of
https://github.com/Jackett/Jackett
synced 2025-02-25 15:42:48 +00:00
core: reduce log traces in info level. add start/stop log traces (#7305)
This commit is contained in:
parent
62769325b4
commit
8c344b2917
2 changed files with 12 additions and 8 deletions
|
@ -104,8 +104,7 @@ namespace Jackett.Common.Services
|
|||
var files = existingDirectories.SelectMany(d => d.GetFiles("*.yml"));
|
||||
var definitions = files.Select(file =>
|
||||
{
|
||||
logger.Info("Loading Cardigann definition " + file.FullName);
|
||||
|
||||
logger.Debug("Loading Cardigann definition " + file.FullName);
|
||||
try
|
||||
{
|
||||
var DefinitionString = File.ReadAllText(file.FullName);
|
||||
|
@ -147,6 +146,7 @@ namespace Jackett.Common.Services
|
|||
|
||||
indexers.Add(indexer.ID, indexer);
|
||||
}
|
||||
logger.Info("Cardigann definitions loaded: " + string.Join(", ", indexers.Keys));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Autofac;
|
||||
|
@ -115,7 +116,8 @@ namespace Jackett.Server
|
|||
#if NET461
|
||||
public void Configure(IApplicationBuilder app, IHostingEnvironment env, IApplicationLifetime applicationLifetime)
|
||||
{
|
||||
applicationLifetime.ApplicationStopping.Register(OnShutdown);
|
||||
applicationLifetime.ApplicationStarted.Register(OnStarted);
|
||||
applicationLifetime.ApplicationStopped.Register(OnStopped);
|
||||
Helper.applicationLifetime = applicationLifetime;
|
||||
app.UseResponseCompression();
|
||||
|
||||
|
@ -154,7 +156,8 @@ namespace Jackett.Server
|
|||
#else
|
||||
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime applicationLifetime)
|
||||
{
|
||||
applicationLifetime.ApplicationStopping.Register(OnShutdown);
|
||||
applicationLifetime.ApplicationStarted.Register(OnStarted);
|
||||
applicationLifetime.ApplicationStopped.Register(OnStopped);
|
||||
Helper.applicationLifetime = applicationLifetime;
|
||||
app.UseResponseCompression();
|
||||
|
||||
|
@ -197,11 +200,12 @@ namespace Jackett.Server
|
|||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
private void OnShutdown()
|
||||
private static void OnStarted()
|
||||
{
|
||||
//this code is called when the application stops
|
||||
var elapsed = (DateTime.Now - Process.GetCurrentProcess().StartTime).TotalSeconds;
|
||||
Helper.Logger.Info($"Jackett startup finished in {elapsed:0.000} s");
|
||||
}
|
||||
|
||||
private static void OnStopped() => Helper.Logger.Info($"Jackett stopped");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue