spateo.external.lack ==================== .. py:module:: spateo.external.lack Classes ------- .. autoapisummary:: spateo.external.lack.Logger spateo.external.lack.LoggerManager Functions --------- .. autoapisummary:: spateo.external.lack.silence_logger spateo.external.lack.set_logger_level spateo.external.lack.format_logging_message Module Contents --------------- .. py:function:: silence_logger(name) Given a logger name, silence it completely. :param name: name of the logger :type name: str .. py:function:: set_logger_level(name, level) Given a logger name, silence it completely. :param name: name of the logger :type name: str .. py:function:: format_logging_message(msg, logging_level, indent_level=1, indent_space_num=6) .. py:class:: Logger(namespace='main', level=None) Aristotle ecosystem-specific logger setting up logging for the package. .. py:attribute:: FORMAT :value: '%(message)s' .. py:attribute:: namespace .. py:attribute:: logger .. py:attribute:: previous_timestamp .. py:attribute:: time_passed :value: 0 .. py:attribute:: report_hook_percent_state :value: None .. py:attribute:: propagate :value: False .. py:method:: namespaced(namespace) Function decorator to set the logging namespace for the duration of the function. :param namespace: the namespace :type namespace: str .. py:method:: namespaced_context(namespace) Context manager to set the logging namespace. :param namespace: the namespace :type namespace: str .. py:method:: namespace_message(message) Add namespace information at the beginning of the logging message. :param message: the logging message :type message: str :return: namespaced message :rtype: string .. py:method:: setLevel(*args, **kwargs) .. py:method:: debug(message, indent_level=1, *args, **kwargs) .. py:method:: info(message, indent_level=1, *args, **kwargs) .. py:method:: warning(message, indent_level=1, *args, **kwargs) .. py:method:: exception(message, indent_level=1, *args, **kwargs) .. py:method:: critical(message, indent_level=1, *args, **kwargs) .. py:method:: error(message, indent_level=1, *args, **kwargs) .. py:method:: info_insert_adata(key, adata_attr='obsm', indent_level=1, *args, **kwargs) .. py:method:: info_insert_adata_var(key, indent_level=1, *args, **kwargs) .. py:method:: info_insert_adata_obsm(key, indent_level=1, *args, **kwargs) .. py:method:: info_insert_adata_uns(key, indent_level=1, *args, **kwargs) .. py:method:: log_time() .. py:method:: report_progress(percent=None, count=None, total=None, progress_name='', indent_level=1) .. py:method:: finish_progress(progress_name='', time_unit='s', indent_level=1) .. py:method:: request_report_hook(bn: int, rs: int, ts: int) -> None A callback required by the request lib: The reporthook argument should be a callable that accepts a block number, a read size, and the total file size of the URL target. The data argument should be valid URL encoded data. :param bs: block number :param rs: read size :param ts: total size .. py:class:: LoggerManager(namespace: str = 'lack', temp_timer_logger: str = 'lack-temp-timer-logger') .. py:attribute:: DEBUG .. py:attribute:: INFO .. py:attribute:: CRITICAL .. py:attribute:: EXCEPTION .. py:method:: gen_logger(namespace: str) :staticmethod: .. py:attribute:: temp_timer_logger .. py:method:: set_main_logger_namespace(namespace: str) .. py:method:: get_main_logger() .. py:method:: get_temp_timer_logger() .. py:method:: progress_logger(generator, logger=None, progress_name='', indent_level=1) .. py:method:: main_set_level(level) .. py:method:: main_info(message, indent_level=1) .. py:method:: main_debug(message, indent_level=1) .. py:method:: main_warning(message, indent_level=1) .. py:method:: main_exception(message, indent_level=1) .. py:method:: main_critical(message, indent_level=1) .. py:method:: main_tqdm(generator, desc='', indent_level=1, logger=None) a TQDM style wrapper for logging something like a loop. e.g. for item in main_tqdm(alist, desc=""): do something :param generator: same as what you put in tqdm :type generator: [type] :param desc: description of your progress :type desc: str, optional .. py:method:: main_log_time() .. py:method:: main_silence() .. py:method:: main_finish_progress(progress_name='') .. py:method:: main_info_insert_adata(key, adata_attr='obsm', indent_level=1, *args, **kwargs) .. py:method:: main_info_insert_adata_var(key, indent_level=1, *args, **kwargs) .. py:method:: main_info_insert_adata_uns(key, indent_level=1, *args, **kwargs) .. py:method:: main_info_insert_adata_obsm(key, indent_level=1, *args, **kwargs) .. py:method:: main_info_insert_adata_obs(key, indent_level=1, *args, **kwargs) .. py:method:: main_info_insert_adata_layer(key, indent_level=1, *args, **kwargs) .. py:method:: main_info_verbose_timeit(msg)