7fV-ddlZddlZddlZddlZddlZddlZddlZddlmZddl m Z ddlm Z ddl m Z mZmZmZmZmZmZddlmZmZmZmZmZmZddlmZddlmZdd lm Z dd l!m"Z"dd l#m$Z$m%Z%dd l&m'Z'dd l(m)Z)ddl*m+Z+ej,Z-e%dZ.Gdde/Z0dee1de1de2fdZ3ej4d+de5dedfdZ6de5fdZ7Gddej8Z9eGddZ:Gdd eZ;Gd!d"ej<j=Z>Gd#d$e Z?Gd%d&e Z@d'e5d(e2d)eeAde5fd*ZBdS),N) dataclass) TextIOWrapper)Filter)AnyClassVar GeneratorListOptionalTextIOType)ConsoleConsoleOptionsConsoleRenderableRenderableType RenderResultRichCast)NullHighlighter) RichHandler)Segment)Style)VERBOSE getLogger)WINDOWS)DEPRECATION_MSG_PREFIX) ensure_dirzpip.subprocessorceZdZdZdS)BrokenStdoutLoggingErrorzO Raised if BrokenPipeError occurs for the stdout stream while logging. N)__name__ __module__ __qualname____doc__{/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib/python3.11/site-packages/pip/_internal/utils/logging.pyrr#sr#r exc_classexcreturnc|turdStsdSt|to|jtjtjfvS)NTF)BrokenPipeErrorr isinstanceOSErrorerrnoEINVALEPIPE)r%r&s r$_is_broken_pipe_errorr/)sFO##t u c7 # # P elEK5P(PPr#num)NNNc#Ktt_txj|z c_ dVtxj|zc_dS#txj|zc_wxYw)zv A context manager which will cause the log output to be indented for any log messages emitted inside it. N)get_indentation _log_state indentation)r1s r$ indent_logr66sr-..Jc!& #% #%s A A#c.ttddS)Nr5r)getattrr4r"r#r$r3r3Es :}a 0 00r#c leZdZdZdddedededdffd Zd ed edefd Z d e j deffd Z xZ S)IndentingFormatterz%Y-%m-%dT%H:%M:%SF) add_timestampargsr;kwargsr'NcH||_tj|i|dS)z A logging.Formatter that obeys the indent_log() context manager. :param add_timestamp: A bool indicating output lines should be prefixed with their record's timestamp. N)r;super__init__)selfr;r<r= __class__s r$r@zIndentingFormatter.__init__Ls/+$)&)))))r# formattedlevelnoc|tjkrdS|trdS|tjkrdSdS)zv Return the start of the formatted log message (not counting the prefix to add to each line). z WARNING: zERROR: )loggingWARNING startswithrERROR)rArCrDs r$get_message_startz$IndentingFormatter.get_message_start[sK W_ $ $2    6 7 7 2 W] " ";yr#recordc^t|}|||j}||z}d|jr||ddt zz dfd|dD}|S)z Calls the standard formatter, but will indent all of the log message lines by our current indentation level. rF cg|]}|zSr"r").0lineprefixs r$ z-IndentingFormatter.format..xsRRRtVd]RRRr#T) r?formatrKrDr; formatTimer3join splitlines)rArLrC message_startrRrBs @r$rTzIndentingFormatter.formatks GGNN6** ..y&.II !I-    3//222F#))))GGRRRRy7K7KD7Q7QRRRSS r#)rrr default_time_formatrboolr@strintrKrG LogRecordrT __classcell__rBs@r$r:r:Is- $ * * * * * *  * * * * * *3 W.3r#r:c8eZdZUeed<eed<dededefdZ dS)IndentedRenderable renderableindentconsoleoptionsr'c#K||j|}tj|}|D]4}td|jzV|Ed{VtdV5dS)NrN )renderrbr split_linesrc)rArdresegmentslinesrQs r$__rich_console__z#IndentedRenderable.__rich_console__s>>$/7;;#H--  D# +,, , , ,OOOOOOO$--      r#N) rrr r__annotations__r\r rrrlr"r#r$rara|sW KKK  )7       r#raceZdZUgZeeeeed<dee de ddffd Z de j ddfdZde j ddffd ZxZS) RichPipStreamHandlerKEYWORDSstreamno_colorr'Nctt||ddddtdS)NT)filerr soft_wrapF)rd show_time show_level show_path highlighter)r?r@r r)rArqrrrBs r$r@zRichPipStreamHandler.__init__sR (dKKK'))      r#rLcd}t|ddrrt|jtsJ|j\}t|tt t fs J|dt|t}n}| |}| ||}|j K|j tj krtd}n%|j tjkrtd} |j|dd| dS#t$$r||YdSwxYw) NrichFz is not rich-console-renderable)rcred)coloryellowignore)overflowcropstyle)r8r*r<tuplerrr[rar3rTrender_messagerDrGrJrrHrdprint Exception handleError)rArLrrich_renderablerbmessages r$emitzRichPipStreamHandler.emitsx!% 665 ) ) 2fk511 1 11!' _"3Xs!C C C!BBB C C*<(9(9***JJkk&))G,,VW==J~)>W]22!...EE^w66!111E % L  zH5PU  V V V V V % % %   V $ $ $ $ $ $ %sD$$EEctjdd\}}|r8|r6|jjtjurt ||rt t|S)z1Called when logging is unable to log some output.Nr0) sysexc_infordrtstdoutr/rr?r)rArLr%r&rBs r$rz RichPipStreamHandler.handleErrors{+ 3  - - !SZ//%i550+,, ,ww""6***r#)rrr rprr r r[rmr rZr@rGr]rrr^r_s@r$roros.0HhxS *+000 x/ 4 D      %7,%%%%%8+'"3+++++++++++r#roc$eZdZdeffd ZxZS)BetterRotatingFileHandlerr'cttj|jt SN)rospathdirname baseFilenamer?_open)rArBs r$rzBetterRotatingFileHandler._opens427??4#455666ww}}r#)rrr rrr^r_s@r$rrsD}r#rc8eZdZdeddfdZdejdefdZdS)MaxLevelFilterlevelr'Nc||_dSr)r)rArs r$r@zMaxLevelFilter.__init__s  r#rLc"|j|jkSr)rDr)rArLs r$filterzMaxLevelFilter.filters~ **r#) rrr r\r@rGr]rZrr"r#r$rrs[cd+W.+4++++++r#rc6eZdZdZdejdeffd ZxZS)ExcludeLoggerFilterzQ A logging Filter that excludes records from a logger (or its children). rLr'cHt| Sr)r?r)rArLrBs r$rzExcludeLoggerFilter.filters77>>&))))r#) rrr r!rGr]rZrr^r_s@r$rrsX*W.*4**********r#r verbosityrr user_log_filec|dkr tj}nS|dkrt}nE|dkr tj}n2|dkr tj}n|dkr tj}n tj}tj|}|du}|r|}d}nd}|}|d vrd nd}d d d } ddd} gd|rdgngz} tj dddtjddtj ddtj ddtddtdddd|| d|| d d!d"gd#d$d | d|| d%d!gd#d$|| d| d%|d&gd#d'd| d(|d)dd*d+d,|| d-d.d/|iid0|S)1znConfigures and sets up all of the logging Returns the requested logging level, as its integer value. r0NDEBUGz /dev/null)INFOrJrHzext://sys.stdoutzext://sys.stderr)rstderrz0pip._internal.utils.logging.RichPipStreamHandlerz5pip._internal.utils.logging.BetterRotatingFileHandler)rqrt)rdconsole_errorsconsole_subprocessuser_logFz*pip._internal.utils.logging.MaxLevelFilter)()rzlogging.Filter)rnamez/pip._internal.utils.logging.ExcludeLoggerFilter)exclude_warningsrestrict_to_subprocessexclude_subprocessz %(message)s)rrTT)rrTr;)rcindent_with_timestamprqrrrrc)rclassrrrqfilters formatterrr)rrrqrrrrrtzutf-8r)rrfilenameencodingdelayr)rdrrr)rhandlersz pip._vendorr)versiondisable_existing_loggersr formattersrrootloggers) rGrrrHrJCRITICALr getLevelNameconfig dictConfigsubprocess_loggerrr:) rrrr level_numberrinclude_user_logadditional_log_file root_levelvendored_log_level log_streamshandler_classesrs r$ setup_loggingrsA~~} a b b} b' |   . .E%D0+ ) ',/@&@&@g%$K EGOCBB(0 bH N(-G$_%% +-2++ L-2''   -+ -+%)**  #,X6 ()(3 46HI!) ',X6 ()(3 45!) ###,X6)(3 ( 89!) ''%,V4 3 '!!8 7##J$$&1C'DEIE E GGGR r#)r0)C contextlibr,rGlogging.handlersrr threading dataclassesriorrtypingrrrr r r r pip._vendor.rich.consoler rrrrrpip._vendor.rich.highlighterrpip._vendor.rich.loggingrpip._vendor.rich.segmentrpip._vendor.rich.stylerpip._internal.utils._logrrpip._internal.utils.compatrpip._internal.utils.deprecationrpip._internal.utils.miscrlocalr4rrr BaseExceptionrZr/contextmanagerr\r6r3 Formatterr:rarorRotatingFileHandlerrrrr[rr"r#r$rs  !!!!!!IIIIIIIIIIIIIIIIII988888000000,,,,,,((((((77777777......BBBBBB////// Y_   I011y QT-%8 Q} QQU Q Q Q Q  & &C & *: ; & & & &1111100000*000f            9+9+9+9+9+;9+9+9+x 0 D +++++V+++*****&***zSzDz#zSVzzzzzzr#