xiN1 ddlmZddlZddlZddlmZddlmZmZddlmZddl m Z m Z m Z m Z mZmZmZe rddlmZdd lmZmZdd lmZdd lmZdd lmZdd lmZddlmZddlmZddl m!Z!GddeZ"e#dkrddl$m%Z%dZ&ej'de&de"ddgej(dZ)e)*de)*de%de)*de)*de)*d e)+d!e%de),d"d#d$gd%d&gd'd(d#ddd'd)e),d*e)-d+e)*d,e)*d-e)+d.d7d1Z.e.e%de)/d2e)*d3e)*d4e0d56dSdS)8) annotationsN)datetime)Handler LogRecord) ModuleType) TYPE_CHECKINGClassVarIterableListOptionalTypeUnion)FormatTimeCallable)ConsoleConsoleRenderable) Highlighter Traceback)NullFile) get_console) LogRender)ReprHighlighter)TextceZdZUdZgdZded<eZded<ej dfddddddd d dd d ddd d d ddddddBfd4Z dCd8Z dDd9Z dEd=Z dFdAZxZS)G RichHandlera A logging handler that renders output with Rich. The time / level / message and file are displayed in columns. The level is color coded, and the message is syntax highlighted. Note: Be careful when enabling console markup in log messages if you have configured logging for libraries not under your control. If a dependency writes messages containing square brackets, it may not produce the intended output. Args: level (Union[int, str], optional): Log level. Defaults to logging.NOTSET. console (:class:`~rich.console.Console`, optional): Optional console instance to write logs. Default will use a global console instance writing to stdout. show_time (bool, optional): Show a column for the time. Defaults to True. omit_repeated_times (bool, optional): Omit repetition of the same time. Defaults to True. show_level (bool, optional): Show a column for the level. Defaults to True. show_path (bool, optional): Show the path to the original log call. Defaults to True. enable_link_path (bool, optional): Enable terminal link of path column to file. Defaults to True. highlighter (Highlighter, optional): Highlighter to style log messages, or None to use ReprHighlighter. Defaults to None. markup (bool, optional): Enable console markup in log messages. Defaults to False. rich_tracebacks (bool, optional): Enable rich tracebacks with syntax highlighting and formatting. Defaults to False. tracebacks_width (Optional[int], optional): Number of characters used to render tracebacks, or None for full width. Defaults to None. tracebacks_code_width (int, optional): Number of code characters used to render tracebacks, or None for full width. Defaults to 88. tracebacks_extra_lines (int, optional): Additional lines of code to render tracebacks, or None for full width. Defaults to None. tracebacks_theme (str, optional): Override pygments theme used in traceback. tracebacks_word_wrap (bool, optional): Enable word wrapping of long tracebacks lines. Defaults to True. tracebacks_show_locals (bool, optional): Enable display of locals in tracebacks. Defaults to False. tracebacks_suppress (Sequence[Union[str, ModuleType]]): Optional sequence of modules or paths to exclude from traceback. tracebacks_max_frames (int, optional): Optional maximum number of frames returned by traceback. locals_max_length (int, optional): Maximum length of containers before abbreviating, or None for no abbreviation. Defaults to 10. locals_max_string (int, optional): Maximum length of string before truncating, or None to disable. Defaults to 80. log_time_format (Union[str, TimeFormatterCallable], optional): If ``log_time`` is enabled, either string for strftime or callable that formats the time. Defaults to "[%x %X] ". keywords (List[str], optional): List of words to highlight instead of ``RichHandler.KEYWORDS``. )GETPOSTHEADPUTDELETEOPTIONSTRACEPATCHzClassVar[Optional[List[str]]]KEYWORDSzClassVar[Type[Highlighter]]HIGHLIGHTER_CLASSNTFXd Pz[%x %X]) show_timeomit_repeated_times show_level show_pathenable_link_path highlightermarkuprich_tracebackstracebacks_widthtracebacks_code_widthtracebacks_extra_linestracebacks_themetracebacks_word_wraptracebacks_show_localstracebacks_suppresstracebacks_max_frameslocals_max_lengthlocals_max_stringlog_time_formatkeywordslevelUnion[int, str]consoleOptional[Console]r-boolr.r/r0r1r2Optional[Highlighter]r3r4r5 Optional[int]r6r7intr8 Optional[str]r9r:r; Iterable[Union[str, ModuleType]]r<r=r>r?Union[str, FormatTimeCallable]r@Optional[List[str]]returnNonect||p t|_|p||_t |||||d|_||_| |_ | |_ | |_ | |_ ||_ ||_||_||_||_| |_||_||_||_dS)N)rA)r-r/r0 time_formatr. level_width)super__init__rrCr&r2r _log_renderr1r3r4r5r7r8r9r:r;r<r6r=r>r@)selfrArCr-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@ __class__s d/home/jenkins/jenkins/workspace/simtester-sanitize/venv/lib/python3.11/site-packages/rich/logging.pyrSzRichHandler.__init__Gs4 u%%%/+-- &B$*@*@*B*B$!' 3    !1 . 0&<# 0$8!&<##6 %:"%:"!2!2  recordrrc|j}tj|dd|}|S)zGet the level name from the record. Args: record (LogRecord): LogRecord instance. Returns: Text: A tuple of the style and level name. zlogging.level.) levelnamerstyledljustlower)rUrY level_name level_texts rWget_level_textzRichHandler.get_level_text{sM% [   Q  !F*2B2B2D2D!F!F  rXc||}d}|jr|jr|jdkr|j\}}}|J|Jddlm}|j||||j|j|j|j |j |j |j |j |j|j }|}|jry||_|j}t'|dr4|r |||j|_||}|||} |||| } t7|jjt<r||dS |j | dS#tB$r||YdSwxYw)zInvoked by logging.N)NNNrr) width code_width extra_linestheme word_wrap show_localsr=r>suppress max_framesusesTime)rY tracebackmessage_renderable)"formatr4exc_informrfrom_exceptionr5r6r7r8r9r:r=r>r;r< getMessage formattermessagehasattrrl formatTimedatefmtasctime formatMessagerender_messagerender isinstancerCfiler handleErrorprint Exception) rUrYrtrmexc_type exc_value exc_tracebackrrsrnlog_renderables rWemitzRichHandler.emits"++f%%   : :#55517 .Hi'''((( , , , , , ,0 0+5 7+3 7"&"8"&"815I''))G~ :!'!2!2!4!4 N 9j11Ui6H6H6J6JU%.%9%9&)BS%T%TFN#11&99!00AAYCU%   dl' 2 2 )   V $ $ $ $ $ ) "">22222 ) ) )  (((((( )sF00GGrtstrrc,t|d|j}|rtj|nt|}t|d|j}|r ||}|j |j|_|jr||jd|S)zRender message text in to Text. Args: record (LogRecord): logging Record. message (str): String containing log message. Returns: ConsoleRenderable: Renderable to display log message. r3r2Nzlogging.keyword)getattrr3r from_markupr2r@r%highlight_words)rUrYrt use_markup message_textr2s rWrzzRichHandler.render_messagesVXt{;; 4>Qt'000DMM fmT5EFF  5&;|44L =  MDM = K  ( (8I J J JrXrmOptional[Traceback]rnc Ltj|j}||}|jdn |jj}tj|j }| |j |s|gn||g|||||j |j r|jnd}|S)avRender log for display. Args: record (LogRecord): logging Record. traceback (Optional[Traceback]): Traceback instance or None for no Traceback. message_renderable (ConsoleRenderable): Renderable (typically Text) containing log message contents. Returns: ConsoleRenderable: Renderable to display log. N)log_timerPrApathline_no link_path)osrbasenamepathnamerbrsrwr fromtimestampcreatedrTrClinenor1) rUrYrmrnrrArPrrs rWr{zRichHandler.renders"w00##F++"n4dd$.:P )&.99)) L(1 V  8JI7V#M)-)>HfooD*   rX).rArBrCrDr-rEr.rEr/rEr0rEr1rEr2rFr3rEr4rEr5rGr6rGr7rHr8rIr9rEr:rEr;rJr<rHr=rHr>rHr?rKr@rLrMrN)rYrrMr)rYrrMrN)rYrrtrrMr)rYrrmrrnrrMr)__name__ __module__ __qualname____doc__r%__annotations__rr&loggingNOTSETrSrbrrzr{ __classcell__)rVs@rWrrs-  D / / /H    6EDDDD")%)2! $(!%-1 %*./1&'*.%)',@B%(!#!#:C(,12!2!2!2!2!2!2!2!h    2)2)2)2)h2        rXr__main__)sleepz %(message)srz[%X]T)r4r:)rArorwhandlersrichzServer starting...z"Listening on http://127.0.0.1:8080zGET /index.html 200 1298z)GET /imgs/backgrounds/back1.jpg 200 54386zGET /css/styles.css 200 54386zGET /favicon.ico 404 242zJSONRPC request --> %r <-- %rz1.1confirmFruitPurchase)appleorangemangoespomelog+? 194521489)versionmethodparamsid)rresulterrorrzrLoading configuration file /adasd/asdasd/qeqwe/qwrqwrqwr/sdgsdgsdg/werwerwer/dfgerert/ertertert/ertetert/werwerwerz$Unable to find 'pomelo' in database!zPOST /jsonrpc/ 200 65532zPOST /admin/ 401 42234z%password was rejected for admin site.rMrNcd}d}dgdz}td ||z dS#tdYdSxYw)Nrrfoor*z in dividezAn error of some kind occurred!)logdebug exception)numberdivisorfooss rWdivider#sdw} + = W     = MM; < < < < < rs"""""" &&&&&&&&QQQQQQQQQQQQQQQQQQ%//////33333333(((((($$$$$$$$$$$$""""""((((((_____'___D z FG+d4PPPQ  ' F # #CHH !"""HH 1222 E!HHHHH '(((HH 8999HH ,---KK*+++ E!HHHII),???G   TD LL   II|II4555HH '(((HH %&&&KK7888==== FHHH E!HHHLL!"""HH )***HH &dd$.?.?.?H@@@@@orX