/// <summary> /// 格式化 /// </summary> public string Format(string format, object arg, IFormatProvider formatProvider) { if (!(arg is ILogContent content)) { return(string.Empty); } return(_format.Format(content)); }
/// <summary> /// 格式化 /// </summary> /// <param name="format">包含格式规范的格式字符串。</param> /// <param name="arg">要设置格式的对象。</param> /// <param name="formatProvider">一个对象,它提供有关当前实例的格式信息。</param> /// <returns></returns> public string Format(string format, object arg, IFormatProvider formatProvider) { var content = arg as ILogContent; if (content == null) { return(string.Empty); } return(_format.Format(content)); }