diff options
Diffstat (limited to 'MediaBrowser.Common/Events/EventHelper.cs')
| -rw-r--r-- | MediaBrowser.Common/Events/EventHelper.cs | 52 |
1 files changed, 4 insertions, 48 deletions
diff --git a/MediaBrowser.Common/Events/EventHelper.cs b/MediaBrowser.Common/Events/EventHelper.cs index 2bb52f0ae..2630ce7da 100644 --- a/MediaBrowser.Common/Events/EventHelper.cs +++ b/MediaBrowser.Common/Events/EventHelper.cs @@ -1,9 +1,10 @@ -using MediaBrowser.Model.Logging; +using Microsoft.Extensions.Logging; using System; using System.Threading.Tasks; namespace MediaBrowser.Common.Events { + // TODO: @bond Remove /// <summary> /// Class EventHelper /// </summary> @@ -28,7 +29,7 @@ namespace MediaBrowser.Common.Events } catch (Exception ex) { - logger.ErrorException("Error in event handler", ex); + logger.LogError(ex, "Error in event handler"); } }); } @@ -54,55 +55,10 @@ namespace MediaBrowser.Common.Events } catch (Exception ex) { - logger.ErrorException("Error in event handler", ex); + logger.LogError(ex, "Error in event handler"); } }); } } - - /// <summary> - /// Fires the event. - /// </summary> - /// <param name="handler">The handler.</param> - /// <param name="sender">The sender.</param> - /// <param name="args">The <see cref="EventArgs" /> instance containing the event data.</param> - /// <param name="logger">The logger.</param> - public static void FireEventIfNotNull(EventHandler handler, object sender, EventArgs args, ILogger logger) - { - if (handler != null) - { - try - { - handler(sender, args); - } - catch (Exception ex) - { - logger.ErrorException("Error in event handler", ex); - } - } - } - - /// <summary> - /// Fires the event. - /// </summary> - /// <typeparam name="T"></typeparam> - /// <param name="handler">The handler.</param> - /// <param name="sender">The sender.</param> - /// <param name="args">The args.</param> - /// <param name="logger">The logger.</param> - public static void FireEventIfNotNull<T>(EventHandler<T> handler, object sender, T args, ILogger logger) - { - if (handler != null) - { - try - { - handler(sender, args); - } - catch (Exception ex) - { - logger.ErrorException("Error in event handler", ex); - } - } - } } } |
