o
    ?e                     @   s   d Z ddlZddlZddlZddlmZ ddlmZ dZ	dZ
dadaeeds,eedr.d	aed
dddZeddd Zdd Zdd Zdd Zdd Zdd Zdd ZdS )z Logging and debugging utilities.    N)
tf_logging)	tf_exportZAUTOGRAPH_VERBOSITYFps1Zps2Tzautograph.set_verbosityc                 C   s   | a |adS )a  Sets the AutoGraph verbosity level.

  _Debug logging in AutoGraph_

  More verbose logging is useful to enable when filing bug reports or doing
  more in-depth debugging.

  There are two means to control the logging verbosity:

   * The `set_verbosity` function

   * The `AUTOGRAPH_VERBOSITY` environment variable

  `set_verbosity` takes precedence over the environment variable.

  For example:

  ```python
  import os
  import tensorflow as tf

  os.environ['AUTOGRAPH_VERBOSITY'] = '5'
  # Verbosity is now 5

  tf.autograph.set_verbosity(0)
  # Verbosity is now 0

  os.environ['AUTOGRAPH_VERBOSITY'] = '1'
  # No effect, because set_verbosity was already called.
  ```

  Logs entries are output to [absl](https://abseil.io)'s
  [default output](https://abseil.io/docs/python/guides/logging),
  with `INFO` level.
  Logs can be mirrored to stdout by using the `alsologtostdout` argument.
  Mirroring is enabled by default when Python runs in interactive mode.

  Args:
    level: int, the verbosity level; larger values specify increased verbosity;
      0 means no logging. When reporting bugs, it is recommended to set this
      value to a larger number, like 10.
    alsologtostdout: bool, whether to also output log messages to `sys.stdout`.
  N)verbosity_levelecho_log_to_stdout)levelZalsologtostdout r   m/home/www/facesmatcher.com/pyenv/lib/python3.10/site-packages/tensorflow/python/autograph/utils/ag_logging.pyset_verbosity$   s   /r
   zautograph.tracec                  G   s   t |   dS )a{  Traces argument information at compilation time.

  `trace` is useful when debugging, and it always executes during the tracing
  phase, that is, when the TF graph is constructed.

  _Example usage_

  ```python
  import tensorflow as tf

  for i in tf.range(10):
    tf.autograph.trace(i)
  # Output: <Tensor ...>
  ```

  Args:
    *args: Arguments to print to `sys.stdout`.
  N)print)argsr   r   r	   traceW   s   r   c                   C   s   t d urt S ttttS N)r   intosgetenvVERBOSITY_VAR_NAMEDEFAULT_VERBOSITYr   r   r   r	   get_verbosityn   s   r   c                 C   s
   t  | kS r   )r   )r   r   r   r	   has_verbosityu   s   
r   c                 O   s(   t | |  |ddrt  d S d S )Nexc_infoF)r   get	traceback	print_excmsgr   kwargsr   r   r	   _output_to_stdouty   s   r   c                 O   sJ   t | r!tj|g|R i | tr#td| g|R i | d S d S d S )NzERROR: )r   loggingerrorr   r   r   r   r   r   r   r   r	   r      s   r   c                 O   sF   t | rtj|g|R i | tr!t|g|R i | d S d S d S r   )r   r   infor   r   r    r   r   r	   log   s   r"   c                 O   sH   t j| g|R i | tr"td|  g|R i | tj  d S d S )Nz	WARNING: )r   warningr   r   sysstdoutflushr   r   r   r	   r#      s
   r#   )F)__doc__r   r$   r   Ztensorflow.python.platformr   r   Z tensorflow.python.util.tf_exportr   r   r   r   r   hasattrr
   r   r   r   r   r   r"   r#   r   r   r   r	   <module>   s,   2
