using log4net;
using System;
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
namespace Muchinfo.PC.Common.Helpers
{
public class LogHelper
{
// private static Window1 window = null;
///
/// 写错误日志
///
/// The message.
public static void WriteError(Type t, string message)
{
//避免写日志循环
try
{
var log = LogManager.GetLogger(t);
if (log.IsErrorEnabled)
{
log.Error(message);
}
}
catch
{
}
}
///
/// 写信息日志
///
/// The message.
public static void WriteInfo(string message)
{
//避免写日志循环
try
{
var log = LogManager.GetLogger(typeof(LogHelper));
if (log.IsInfoEnabled)
{
log.Info(message);
}
}
catch
{
}
}
}
}