|
| 1 | +namespace AzureMapsControl.Components.Logger |
| 2 | +{ |
| 3 | + using Microsoft.Extensions.Logging; |
| 4 | + |
| 5 | + internal enum AzureMapLogEvent |
| 6 | + { |
| 7 | + AzureMap_OnInitialized = 1000, |
| 8 | + AzureMap_OnAfterRenderAsync = 1001, |
| 9 | + AzureMap_AddControlsAsync = 1002, |
| 10 | + AzureMap_ClearSourcesAsync = 1003, |
| 11 | + AzureMap_AddSourceAsync = 1004, |
| 12 | + AzureMap_AttachDataSourcesCallback = 1005, |
| 13 | + AzureMap_RemoveSourceAsync = 1006, |
| 14 | + AzureMap_DataSource_ImportDataFromUrlAsync = 1007, |
| 15 | + AzureMap_DataSource_AddAsync = 1008, |
| 16 | + AzureMap_DataSource_RemoveAsync = 1009, |
| 17 | + AzureMap_DataSource_ClearAsync = 1010, |
| 18 | + AzureMap_DrawingToolbarEvent = 1011, |
| 19 | + AzureMap_AddDrawingToolbarAsync = 1012, |
| 20 | + AzureMap_UpdateDrawingToolbarAsync = 1013, |
| 21 | + AzureMap_RemoveDrawingToolbarAsync = 1014, |
| 22 | + AzureMap_HtmlMarkerEventReceivedAsync = 1015, |
| 23 | + AzureMap_ClearHtmlMarkersAsync = 1016, |
| 24 | + AzureMap_AddHtmlMarkersAsync = 1017, |
| 25 | + AzureMap_RemoveHtmlMarkersAsync = 1018, |
| 26 | + AzureMap_UpdateHtmlMarkersAsync = 1019, |
| 27 | + AzureMap_LayerEventReceivedAsync = 1020, |
| 28 | + AzureMap_ClearLayersAsync = 1021, |
| 29 | + AzureMap_AddLayerAsync = 1022, |
| 30 | + AzureMap_RemoveLayersAsync = 1023, |
| 31 | + AzureMap_MapEventReceivedAsync = 1024, |
| 32 | + AzureMap_SetCameraOptionsAsync = 1025, |
| 33 | + AzureMap_SetStyleOptionsAsync = 1026, |
| 34 | + AzureMap_SetUserInteractionAsync = 1027, |
| 35 | + AzureMap_SetTrafficAsync = 1028, |
| 36 | + AzureMap_ClearMapAsync = 1029, |
| 37 | + AzureMap_AddPopupAsync = 1030, |
| 38 | + AzureMap_Popup_OpenAsync = 1031, |
| 39 | + AzureMap_Popup_CloseAsync = 1032, |
| 40 | + AzureMap_Popup_RemoveAsync = 1033, |
| 41 | + AzureMap_Popup_UpdateAsync = 1034, |
| 42 | + AzureMap_ClearPopupsAsync = 1035, |
| 43 | + AzureMap_PopupEventReceivedAsync = 1036, |
| 44 | + MapService_AddMapAsync = 2000 |
| 45 | + } |
| 46 | + |
| 47 | + internal static class Extensions |
| 48 | + { |
| 49 | + internal static void LogAzureMapsControlTrace(this ILogger logger, AzureMapLogEvent logEvent, string message, params object[] args) => logger.LogAzureMapsControl(LogLevel.Trace, logEvent, message, args); |
| 50 | + internal static void LogAzureMapsControlDebug(this ILogger logger, AzureMapLogEvent logEvent, string message, params object[] args) => logger.LogAzureMapsControl(LogLevel.Debug, logEvent, message, args); |
| 51 | + internal static void LogAzureMapsControlInfo(this ILogger logger, AzureMapLogEvent logEvent, string message, params object[] args) => logger.LogAzureMapsControl(LogLevel.Information, logEvent, message, args); |
| 52 | + internal static void LogAzureMapsControl(this ILogger logger, LogLevel logLevel, AzureMapLogEvent logEvent, string message, params object[] args) => logger.Log(logLevel, new EventId((int)logEvent), message, args); |
| 53 | + } |
| 54 | +} |
0 commit comments