111,098
社区成员




namespace BaseLib
{
public class Test
{
public ILogExt LogExt = LogExtAct.GetLogger(typeof(Test));
public void Main()
{
LogExt.Info("hi !"); // 显示效果: 2016-12-22 12:12:12 BaseLib.Test hi !
}
}
public interface ILogExt
{
void Info(object message);
}
public sealed class LogExtAct
{
public static ILogExt GetLogger(string name)
{
return null; // name; // 这里应该怎么写?谢谢。
}
public static ILogExt GetLogger(Type type)
{
return null; // (Assembly.GetCallingAssembly(), type.FullName); // 这里应该怎么写?谢谢。
}
}
public class LogExtImpl : ILogExt
{
public void Info(object message)
{
var txt = DateTime.Now + "" + message;
Console.WriteLine(txt);
// throw new NotImplementedException();
}
}
}