+
    ^|i                     f    R t ^ RIt^ RIt^ RIHtHtHt ^ RIHt ^ RI	H
t
 ] ! R R]4      4       tR# )z=Implementation of magic functions for IPython's own logging.
N)Magicsmagics_class
line_magic)warn)Boolc                      a  ] tR t^t o Rt]! RRR7      P                  RR7      t]RR l4       t	]RR l4       t
]RR	 l4       t]RR
 l4       t]RR l4       tRtV tR# )LoggingMagicsz(Magics related to all logging machinery.FzF
        Suppress output of log state when logging is enabled
        )helpT)configc                >   V P                  VR4      w  r#RV9   pRV9   pRV9   pRV9   pV P                  P                  pV'       d    VP                  4       w  rMVP                  p	VP
                  p
V P                  P                  pV	'       d    \        P                  P                  V	4      p	WP                  n        Rp VP                  WWVV4       V'       d   RVn        V'       d"   V P                  P                  P                  pM V P                  P                  P                  pV'       d   VP                  pV P                  P                  P                   p\#        ^\%        V4      ^,
          4       FI  pV! VV,          P'                  4       R	,           4       VV9   g   K0  V! \)        VV,          4      R
4       KK  	  M8VP                  R	P+                  VR,          4      4       VP                  R	4       V'       d   RVn        V P,                  '       g(   V'       g   \/        R4       VP1                  4        R# R# R#    Tp	Rp
 EL; i   YP                  n        \3        R\4        P6                  ! 4       ^,          ,          4        R# ; i)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
output:   NNTzGActivating auto-logging. Current session state plus future input saved.zCouldn't start log: %sN)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   &&               =/usr/lib/python3/dist-packages/IPython/core/magics/logging.pyr   LoggingMagics.logstart&   s   v %%k&9D[
t4K	t"" ##&99; 
 HnnG jj((ww))(3H%

+%	"OOHwI)+  $) !ZZ77FF
!ZZ77II
",,	"jj88DDqZ!23Ajm224u<=K'!${1~"6x@ 4
   JrN!;<  '#' JJJ% H I! #(Jc#" 	?!,JJ)CLLN1,==>s   I I I>Jc                N    V P                   P                  P                  4        R# )zFully 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r0   r1   s   &&r:   r=   LoggingMagics.logstop   s     	

!!#    c                P    V P                   P                  P                  ^ 4       R# )zDTemporarily stop logging.

You must have previously started logging.Nr   r   
switch_logr>   s   &&r:   logoffLoggingMagics.logoff   s    
 	

$$Q'r@   c                P    V P                   P                  P                  ^4       R# )zRestart 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.NrB   r>   s   &&r:   logonLoggingMagics.logon   s     	

$$Q'r@   c                N    V P                   P                  P                  4        R# )z'Print the status of the logging system.N)r   r   r-   r>   s   &&r:   r-   LoggingMagics.logstate   s     	

""$r@    N) )__name__
__module____qualname____firstlineno____doc__r   tagr+   r   r   r=   rD   rG   r-   __static_attributes____classdictcell__)__classdict__s   @r:   r   r      s     2	 
cc	 
 {" {"z $ $ ( ( ( ( % %r@   r   )rQ   r   r.   IPython.core.magicr   r   r   warningsr   	traitletsr   r   rK   r@   r:   <module>rY      s?    
 
 @ ?   f%F f% f%r@   