mirror of
https://github.com/Cleanuparr/Cleanuparr.git
synced 2025-12-28 08:28:03 -05:00
23 lines
639 B
C#
23 lines
639 B
C#
using System.Reflection;
|
|
|
|
namespace Executable;
|
|
|
|
public static class HostExtensions
|
|
{
|
|
public static IHost Init(this IHost host)
|
|
{
|
|
ILogger<Program> logger = host.Services.GetRequiredService<ILogger<Program>>();
|
|
|
|
Version? version = Assembly.GetExecutingAssembly().GetName().Version;
|
|
|
|
logger.LogInformation(
|
|
version is null
|
|
? "cleanuperr version not detected"
|
|
: $"cleanuperr v{version.Major}.{version.Minor}.{version.Build}"
|
|
);
|
|
|
|
logger.LogInformation("timezone: {tz}", TimeZoneInfo.Local.DisplayName);
|
|
|
|
return host;
|
|
}
|
|
} |