ó
    Ñ]jÓ  ã                   ód   • S r SSKrSSKrSSKJrJrJr  SSKJr  SSK	J
r
  \ " S S\5      5       rg)z=Implementation of magic functions for IPython's own logging.
é    N)ÚMagicsÚmagics_classÚ
line_magic)Úwarn)ÚBoolc                   ó¤   • \ rS rSrSr\" SSS9R                  SS9r\SS j5       r	\SS	 j5       r
\SS
 j5       r\SS j5       r\SS j5       rSrg)ÚLoggingMagicsé   z(Magics related to all logging machinery.FzF
        Suppress output of log state when logging is enabled
        )ÚhelpT)Úconfigc                 óì  • U R                  US5      u  p#SU;   nSU;   nSU;   nSU;   nU R                  R                  nU(       a   UR                  5       u  pšOUR                  n	UR
                  n
U R                  R                  nU	(       a  [        R                  R                  U	5      n	X�R                  l        Sn UR                  XœX¤UU5        U(       a  SUl        U(       a!  U R                  R                  R                  nO U R                  R                  R                  nU(       a…  UR                  nU R                  R                  R                   n[#        S	[%        U5      S	-
  5       H<  nU" UU   R'                  5       S
-   5        UU;   d  M'  U" [)        UU   5      S5        M>     O4UR                  S
R+                  US	S 5      5        UR                  S
5        U(       a  SUl        U R,                  (       d$  U(       d  [/        S5        UR1                  5         ggg!   Un	Sn
 GNÆ= f!   X°R                  l        [3        S[4        R6                  " 5       S	   -  5         g= f)a»  Start logging anywhere in a session.

%logstart [-o|-r|-t|-q] [log_name [log_mode]]

If no name is given, it defaults to a file named 'ipython_log.py' in your
current directory, in 'rotate' mode (see below).

'%logstart name' saves to file 'name' in 'backup' mode.  It saves your
history up to that point and then continues logging.

%logstart takes a second optional parameter: logging mode. This can be one
of (note that the modes are given unquoted):

append
    Keep logging at the end of any existing file.

backup
    Rename any existing file to name~ and start name.

global
    Append to  a single logfile in your home directory.

over
    Overwrite any existing log.

rotate
    Create rotating logs: name.1~, name.2~, etc.

Options:

  -o
    log also IPython's output. In this mode, all commands which
    generate an Out[NN] prompt are recorded to the logfile, right after
    their corresponding input line. The output lines are always
    prepended with a '#[Out]# ' marker, so that the log remains valid
    Python code.

  Since this marker is always the same, filtering only the output from
  a log is very easy, using for example a simple awk call::

    awk -F'#\[Out\]# ' '{if($2) {print $2}}' ipython_log.py

  -r
    log 'raw' input.  Normally, IPython's logs contain the processed
    input, so that user lines are logged in their final form, converted
    into valid Python.  For example, %Exit is logged as
    _ip.run_line_magic("Exit").  If the -r flag is given, all input is logged
    exactly as typed, with no transformations applied.

  -t
    put timestamps before each input line logged (these are put in
    comments).

  -q
    suppress output of logstate message when logging is invoked
ÚortqÚoÚrÚtÚqÚbackupz# IPython log file

Fé   Ú
ÚoutputNTzGActivating auto-logging. Current session state plus future input saved.zCouldn't start log: %s)Úparse_optionsÚshellÚloggerÚsplitÚlogfnameÚlogmodeÚlogfileÚosÚpathÚ
expanduserÚlogstartÚ	timestampÚhistory_managerÚinput_hist_rawÚinput_hist_parsedÚ	log_writeÚoutput_histÚrangeÚlenÚrstripÚreprÚjoinÚquietÚprintÚlogstater   ÚsysÚexc_info)ÚselfÚparameter_sÚoptsÚparÚ
log_outputÚlog_raw_inputr"   r-   r   r   r   Úold_logfileÚlogheadÚ
input_histr&   r'   Úns                    ÚX/home/mande/repo/quber/.venv/lib/python3.13/site-packages/IPython/core/magics/logging.pyr!   ÚLoggingMagics.logstart&   s  € ðv ×%Ñ% k°&Ó9‰ˆØ˜D‘[ˆ
Ø˜t™ˆØ˜4‘Kˆ	Ø�t‘ˆà—‘×"Ñ"ˆö ð#Ø#&§9¡9£;Ñ �˜ð
 —‘ˆHØ—n‘nˆGð —j‘j×(Ñ(ˆÞÜ—w‘w×)Ñ)¨(Ó3ˆHØ%�
‰
Ôà+ˆð%	"Ø�O‰O˜H¨wÀIØ)ô+ö ð $)�Ô æØ!ŸZ™Z×7Ñ7×FÑF‘
à!ŸZ™Z×7Ñ7×IÑI�
æØ"×,Ñ,�	Ø"Ÿj™j×8Ñ8×DÑD�Ü˜q¤ Z£°Ñ!2Ö3�AÙ˜j¨™m×2Ñ2Ó4°uÑ<Ô=Ø˜KÕ'Ù!¤$ {°1¡~Ó"6°xÖ@ò 4ð
 × Ñ  §¡¨J°q°r¨NÓ!;Ô<Ø× Ñ  Ô'Þà#'�Ô à—J—J¦%Üð Hô Ià—‘Õ!ð #(�Jøðc#Ø�Ø"“ûð 	?Ø!,�J‰JÔÜÐ)¬C¯LªL«N¸1Ñ,=Ñ=Ö>ús   ÁH/ ÃH; È/H8È;6I3c                 óL   • U R                   R                  R                  5         g)z¾Fully stop logging and close log file.

In order to start logging again, a new %logstart call needs to be made,
possibly (though not necessarily) with a new filename, mode and other
options.N)r   r   Úlogstop©r2   r3   s     r<   r?   ÚLoggingMagics.logstop¤   s   € ð 	�
‰
×Ñ×!Ñ!Õ#ó    c                 óN   • U R                   R                  R                  S5        g)zDTemporarily stop logging.

You must have previously started logging.r   N©r   r   Ú
switch_logr@   s     r<   ÚlogoffÚLoggingMagics.logoff­   s   € ð
 	�
‰
×Ñ×$Ñ$ QÕ'rB   c                 óN   • U R                   R                  R                  S5        g)zìRestart logging.

This function is for restarting logging which you've temporarily
stopped with %logoff. For starting logging for the first time, you
must use the %logstart function, which allows you to specify an
optional log filename.r   NrD   r@   s     r<   ÚlogonÚLoggingMagics.logon´   s   € ð 	�
‰
×Ñ×$Ñ$ QÕ'rB   c                 óL   • U R                   R                  R                  5         g)z'Print the status of the logging system.N)r   r   r/   r@   s     r<   r/   ÚLoggingMagics.logstate¿   s   € ð 	�
‰
×Ñ×"Ñ"Õ$rB   © N)Ú )Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Útagr-   r   r!   r?   rF   rI   r/   Ú__static_attributes__rM   rB   r<   r	   r	      sŽ   † á2á�ð	ñ÷ 
�c�€cÐð	 
ð ó{"ó ð{"ðz ó$ó ð$ð ó(ó ð(ð ó(ó ð(ð ó%ó ó%rB   r	   )rS   r   r0   ÚIPython.core.magicr   r   r   Úwarningsr   Ú	traitletsr   r	   rM   rB   r<   Ú<module>rY      s?   ðñó 
Û 
÷ @Ñ ?Ý Ý ð ôf%�Fó f%ó ñf%rB   