Created
April 29, 2015 21:20
-
-
Save Jalalx/5ea420d997da8fd03619 to your computer and use it in GitHub Desktop.
Extensions for Prism ILoggerFacade interface
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.Practices.Prism.Logging; | |
namespace Microsoft.Practices.Prism.Logging | |
{ | |
public static class ILoggerFacadeExtensions | |
{ | |
public static void Log(this ILoggerFacade logger, string message) | |
{ | |
logger.Log(message, Category.Info, Priority.Medium); | |
} | |
public static void Log(this ILoggerFacade logger, Exception ex, string message, params object[] arg) | |
{ | |
logger.Log(String.Format(message + "\r\nError:" + ex.ToString(), arg), Category.Exception, Priority.High); | |
} | |
public static void Log(this ILoggerFacade logger, Exception ex) | |
{ | |
Log(logger, ex, ""); | |
} | |
public static void Message(this ILoggerFacade logger, string messages, params object[] arg) | |
{ | |
logger.Log(String.Format(messages, arg), Category.Info, Priority.Medium); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment