Ansi2HTMLConverter()html = conv.convert(content, full=True)display(HTML(html))<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title><style type="text/css">.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap: break-word; }.body_foreground { color: #AAAAAA; }.body_background { background-color: #000000; }.inv_foreground { color: #000000; }.inv_background { background-color: #AAAAAA; }.ansi1 { font-weight: bold; }.ansi3 { font-style: italic; }.ansi32 { color: #00aa00; }.ansi36 { color: #00aaaa; }</style></head><body class="body_foreground body_background" style="font-size: normal;" ><pre class="ansi2html-content"><span class="ansi1">&gt; Entering new LLMChain chain...</span>Prompt after formatting:<span class="ansi1 ansi32"></span><span class="ansi1 ansi3 ansi32">1 + 2 = </span><span class="ansi1">&gt; Finished chain.</span><span class="ansi32">2023-06-01 18:36:38.929</span> | <span class="ansi1">INFO    </span> | <span class="ansi36">__main__</span>:<span class="ansi36">&lt;module&gt;</span>:<span class="ansi36">20</span> - <span class="ansi1">3</span></pre></body></html>PreviousCallbacks for custom chainsNextMultiple callback handlersCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.
This example shows how to print logs to file. It shows how to use the FileCallbackHandler, which does the same thing as StdOutCallbackHandler, but instead writes the output to file. It also uses the loguru library to log other outputs that are not captured by the handler.
This example shows how to print logs to file. It shows how to use the FileCallbackHandler, which does the same thing as StdOutCallbackHandler, but instead writes the output to file. It also uses the loguru library to log other outputs that are not captured by the handler. ->: Ansi2HTMLConverter()html = conv.convert(content, full=True)display(HTML(html))<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title></title><style type="text/css">.ansi2html-content { display: inline; white-space: pre-wrap; word-wrap: break-word; }.body_foreground { color: #AAAAAA; }.body_background { background-color: #000000; }.inv_foreground { color: #000000; }.inv_background { background-color: #AAAAAA; }.ansi1 { font-weight: bold; }.ansi3 { font-style: italic; }.ansi32 { color: #00aa00; }.ansi36 { color: #00aaaa; }</style></head><body class="body_foreground body_background" style="font-size: normal;" ><pre class="ansi2html-content"><span class="ansi1">&gt; Entering new LLMChain chain...</span>Prompt after formatting:<span class="ansi1 ansi32"></span><span class="ansi1 ansi3 ansi32">1 + 2 = </span><span class="ansi1">&gt; Finished chain.</span><span class="ansi32">2023-06-01 18:36:38.929</span> | <span class="ansi1">INFO    </span> | <span class="ansi36">__main__</span>:<span class="ansi36">&lt;module&gt;</span>:<span class="ansi36">20</span> - <span class="ansi1">3</span></pre></body></html>PreviousCallbacks for custom chainsNextMultiple callback handlersCommunityDiscordTwitterGitHubPythonJS/TSMoreHomepageBlogCopyright ¬© 2023 LangChain, Inc.