/usr/lib/python3/dist-packages/uaclient/__pycache__
NameSizeModeActions
actions.cpython-310.pyc113810644editdlrm
apt.cpython-310.pyc283670644editdlrm
apt_news.cpython-310.pyc73460644editdlrm
config.cpython-310.pyc137600644editdlrm
contract.cpython-310.pyc248990644editdlrm
contract_data_types.cpython-310.pyc80680644editdlrm
data_types.cpython-310.pyc147880644editdlrm
defaults.cpython-310.pyc29130644editdlrm
event_logger.cpython-310.pyc78400644editdlrm
exceptions.cpython-310.pyc250390644editdlrm
gpg.cpython-310.pyc10250644editdlrm
livepatch.cpython-310.pyc106950644editdlrm
lock.cpython-310.pyc46350644editdlrm
log.cpython-310.pyc46330644editdlrm
secret_manager.cpython-310.pyc12560644editdlrm
security_status.cpython-310.pyc165980644editdlrm
snap.cpython-310.pyc64710644editdlrm
status.cpython-310.pyc183610644editdlrm
system.cpython-310.pyc227620644editdlrm
types.cpython-310.pyc4720644editdlrm
update_contract_info.cpython-310.pyc13320644editdlrm
upgrade_lts_contract.cpython-310.pyc29920644editdlrm
util.cpython-310.pyc135250644editdlrm
version.cpython-310.pyc24990644editdlrm
yaml.cpython-310.pyc11780644editdlrm
__init__.cpython-310.pyc1440644editdlrm
Edit: /usr/lib/python3/dist-packages/uaclient/__pycache__/log.cpython-310.pyc (4633B)
o Ki@sddlZddlZddlZddlZddlmZddlmZmZm Z m Z ddl m Z m Z mZmZddlmZGdddejZGdd d ejZGd d d ejZd efd dZd efddZd e efddZddZde eefdefddZddZdS)N) OrderedDict)AnyDictListUnion)defaultssecret_managersystemutil)UAConfigc@ eZdZdZdejfddZdS)RegexRedactionFilter,A logging filter to redact confidential inforecordcCstt|j|_dSNT)r redact_sensitive_logsstrmsgselfrr./usr/lib/python3/dist-packages/uaclient/log.pyfilterszRegexRedactionFilter.filterN__name__ __module__ __qualname____doc__logging LogRecordrrrrrr r c@r )KnownSecretRedactionFilterrrcCstjt|j|_dSr)rsecretsredact_secretsrrrrrrrsz!KnownSecretRedactionFilter.filterNrrrrrr!r r!c@s0eZdZdZdZdZdZdejde fddZ d S) JsonArrayFormatterzYJson Array Formatter for our logging mechanism Custom made for Pro logging needs z%Y-%m-%dT%H:%M:%Sz%s.%03d)asctime levelnamenamefuncNamelinenomessagerreturncCs||_|||_i}|jr||j|d<|ds%|jr%|j|d<|jr0| |j|d<|j d}|rBt |t rB| |t}|jD] }|j |}|||<qH||d<tt|S)Nexc_info stack_infoextra) getMessager* formatTimer%r,formatExceptiongetexc_textr- formatStack__dict__ isinstancedictupdaterrequired_fieldsjsondumpslistvalues)rrextra_message_dictr.local_log_recordfieldvaluerrrformat,s,        zJsonArrayFormatter.formatN) rrrrdefault_time_formatdefault_msec_formatr9rrrrBrrrrr$s  r$r+cCstrtjStS)z\ Gets the correct log_file path, adjusting for whether the user is root or not. )r we_are_currently_rootr log_fileget_user_log_filerrrrget_user_or_root_log_file_pathJsrHcCstjtdS)z/Gets the correct user log_file storage locationubuntu-pro.log)ospathjoinr get_user_cache_dirrrrrrGUsrGcCsHtd}g}|D]}tjd|dtjd}tj|r!||q |S)z|Gets all the log files for the users in the system Returns a list of all user log files in their home directories. z/homez.cacherI)rJlistdirrKrLrUSER_CACHE_SUBDIRisfileappend)user_directories log_filesuser_directory user_pathrrrget_all_user_log_filesZs   rVcCs\td}|tjt}|t|tj|t|t | |dS)N ubuntupro) r getLoggersetLevelINFO StreamHandler setFormatterr$ addFilterr r! addHandler)loggerconsole_handlerrrrsetup_journald_loggingns      ra log_levelrFcCst|tr |}tst}td}||g|_ t |}| s4|j jddd|jddt|}|t|||t|t||dS)zoSetup logging to log_file If run as non-root then log_file is replaced with a user-specific log file. rWT)parentsexist_oki)modeN)r6rupperr rErGrrXrYhandlerspathlibPathexistsparentmkdirtouch FileHandlerr\r$r]r r!r^)rbrFr_ log_file_path file_handlerrrrsetup_cli_loggingys"          rqcKsd|iS)z A helper for passing extra fields to log statements. Usage: LOG.info("message string", extra=log.extra(field=something_relevant)) r.r)kwargsrrrr.sr.)r:rrJrh collectionsrtypingrrrruaclientrrr r uaclient.configr Filterr r! Formatterr$rrHrGrVraintrqr.rrrrs"  .  !