mirror of
https://github.com/ClemensFischer/XAML-Map-Control.git
synced 2026-04-05 14:37:01 +00:00
Improved logging
This commit is contained in:
parent
fce05c2ed1
commit
2d97f1f2c7
13 changed files with 57 additions and 31 deletions
|
|
@ -82,6 +82,9 @@ namespace MapControl
|
|||
|
||||
private static string QueryString(ushort tag) => $"/ifd/{{ushort={tag}}}";
|
||||
|
||||
private static ILogger logger;
|
||||
private static ILogger Logger => logger ?? (logger = ImageLoader.LoggerFactory?.CreateLogger(nameof(GeoImage)));
|
||||
|
||||
public static readonly DependencyProperty SourcePathProperty =
|
||||
DependencyPropertyHelper.RegisterAttached<string>("SourcePath", typeof(GeoImage), null,
|
||||
async (element, oldValue, newValue) => await LoadGeoImageAsync(element, newValue));
|
||||
|
|
@ -136,7 +139,7 @@ namespace MapControl
|
|||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ImageLoader.LoggerFactory?.CreateLogger(typeof(GeoImage))?.LogError(ex, "Failed loading from {path}", sourcePath);
|
||||
Logger?.LogError(ex, "Failed loading from {path}", sourcePath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue