private static LayoutRenderer ConvertToLiteral(LayoutRenderer renderer) { return new LiteralLayoutRenderer(renderer.Render(LogEventInfo.CreateNullEvent())); }
/// <summary> /// set in Session and test /// </summary> /// <param name="key">set with this key</param> /// <param name="value">set this value</param> /// <param name="expected">expected</param> /// <param name="appSettingLayoutRenderer"></param> /// <remarks>IRenderable is internal</remarks> private void ExecTest(string key, object value, object expected, LayoutRenderer appSettingLayoutRenderer) { Session[key] = value; var rendered = appSettingLayoutRenderer.Render(LogEventInfo.CreateNullEvent()); Assert.Equal(expected, rendered); }
private static LayoutRenderer ConvertToLiteral(LoggingConfiguration cfg, LayoutRenderer renderer) { var closeReq = ObjectGraph.DeepInitialize(renderer, cfg, LogManager.ThrowExceptions); string text = renderer.Render(LogEventInfo.CreateNullEvent()); foreach (var item in closeReq) item.Close(); return new LiteralLayoutRenderer(text); }