
    |;i                        d Z ddlmZ ddlZddlZddlmZmZmZ  ej                  e
j                  dd      d         Zej                   ej                                ddZ e         G d	 d
      Zy)a  Multicast DNS Service Discovery for Python, v0.14-wmcbrine
    )
Copyright 2003 Paul Scott-Murphy, 2014 William McBrine

This module provides a framework for the use of DNS Service Discovery
using IP multicast.

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
USA
    )annotationsN)AnyClassVarcast.   )maxsplitc                     t         j                  t        j                  k(  r$t         j	                  t        j
                         y y )N)loglevelloggingNOTSETsetLevelWARN     C/home/ubuntu/myenv/lib/python3.12/site-packages/zeroconf/_logger.pyset_logger_level_if_unsetr   "   s'    
yyGNN"W\\" #r   c                  d    e Zd ZU i Zded<   edd       Zedd       Zed	d       Zed
d       Z	y)QuietLoggerz ClassVar[dict[str, int | tuple]]
_seen_logsc                    t        j                         }t        |d         }|| j                  vr || j                  |<   t        j
                  }nt        j                  } ||xs dgddi y )Nr   Exception occurredexc_infoT)sysr   strr   r   warningdebug)clslogger_datar   exc_strloggers        r   log_exception_warningz!QuietLogger.log_exception_warning-   s]    <<>hqk"#..(&.CNN7#[[FYYF6!5 6G$Gr   c                    d}t        j                         }t        |d         }|| j                  vr|| j                  |<   d}t	        j
                  |xs dgd|i y )NFr   Tr   r   )r   r   r   r   r   r   )r   r    log_exc_infor   r!   s        r   log_exception_debugzQuietLogger.log_exception_debug9   sY    <<>hqk"#..(&.CNN7#L		K9$8#9R\Rr   c                    |d   }|| j                   vr d| j                   |<   t        j                  }nt        j                  }t	        t
        | j                   |         dz   | j                   |<    ||  y )Nr   r   r   r   r   r   r   int)r   argsmsg_strr"   s       r   log_warning_oncezQuietLogger.log_warning_onceD   sa    q'#..(&'CNN7#[[FYYF"&sCNN7,C"Dq"Hwr   c                    |d   }|| j                   vr d| j                   |<   t        j                  }nt        j                  }t	        t
        | j                   |         dz   | j                   |<    ||d|i y )Nr   r   r   r(   )r   excr*   r+   r"   s        r   log_exception_oncezQuietLogger.log_exception_onceO   sg    q'#..(&'CNN7#[[FYYF"&sCNN7,C"Dq"Hw#s#r   N)r    r   returnNone)r*   r   r0   r1   )r.   	Exceptionr*   r   r0   r1   )
__name__
__module____qualname__r   __annotations__classmethodr#   r&   r,   r/   r   r   r   r   r   *   s_    35J05	H 	H S S   $ $r   r   )r0   r1   )__doc__
__future__r   r   r   typingr   r   r   	getLoggerr3   splitr   
addHandlerNullHandlerr   r   r   r   r   <module>r?      sn   . #  
 & &gsQ7:; "w""$ %#
  .$ .$r   