mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2025-12-06 07:12:04 +01:00
Logger
This commit is contained in:
parent
d01a948cf4
commit
4c5321958a
|
|
@ -43,11 +43,6 @@ namespace MapControl.Caching
|
|||
|
||||
public FileDbCache(FileDbCacheOptions options, ILoggerFactory loggerFactory = null)
|
||||
{
|
||||
if (loggerFactory != null)
|
||||
{
|
||||
logger = loggerFactory.CreateLogger<FileDbCache>();
|
||||
}
|
||||
|
||||
var path = options.Path;
|
||||
|
||||
if (string.IsNullOrEmpty(path) || string.IsNullOrEmpty(Path.GetExtension(path)))
|
||||
|
|
@ -55,6 +50,8 @@ namespace MapControl.Caching
|
|||
path = Path.Combine(path ?? "", "TileCache.fdb");
|
||||
}
|
||||
|
||||
logger = loggerFactory?.CreateLogger<FileDbCache>();
|
||||
|
||||
try
|
||||
{
|
||||
fileDb.Open(path);
|
||||
|
|
|
|||
|
|
@ -39,11 +39,6 @@ namespace MapControl.Caching
|
|||
|
||||
public SQLiteCache(SQLiteCacheOptions options, ILoggerFactory loggerFactory = null)
|
||||
{
|
||||
if (loggerFactory != null)
|
||||
{
|
||||
logger = loggerFactory.CreateLogger<SQLiteCache>();
|
||||
}
|
||||
|
||||
var path = options.Path;
|
||||
|
||||
if (string.IsNullOrEmpty(path) || string.IsNullOrEmpty(Path.GetExtension(path)))
|
||||
|
|
@ -64,6 +59,8 @@ namespace MapControl.Caching
|
|||
command.ExecuteNonQuery();
|
||||
}
|
||||
|
||||
logger = loggerFactory?.CreateLogger<SQLiteCache>();
|
||||
|
||||
logger?.LogInformation("Opened database {path}", path);
|
||||
|
||||
if (options.ExpirationScanFrequency > TimeSpan.Zero)
|
||||
|
|
|
|||
|
|
@ -43,16 +43,13 @@ namespace MapControl.Caching
|
|||
|
||||
public ImageFileCache(ImageFileCacheOptions options, ILoggerFactory loggerFactory = null)
|
||||
{
|
||||
if (loggerFactory != null)
|
||||
{
|
||||
logger = loggerFactory.CreateLogger<ImageFileCache>();
|
||||
}
|
||||
|
||||
var path = options.Path;
|
||||
|
||||
rootDirectory = new DirectoryInfo(!string.IsNullOrEmpty(path) ? path : "TileCache");
|
||||
rootDirectory.Create();
|
||||
|
||||
logger = loggerFactory?.CreateLogger<ImageFileCache>();
|
||||
|
||||
logger?.LogInformation("Started in {name}", rootDirectory.FullName);
|
||||
|
||||
var memoryCacheOptions = new MemoryDistributedCacheOptions();
|
||||
|
|
|
|||
Loading…
Reference in a new issue