logt. Log the time of the inside code Parameters ---------- name : name show_start : show_start
(cls, name="", show_start=False)
| 129 | @classmethod |
| 130 | @contextmanager |
| 131 | def logt(cls, name="", show_start=False): |
| 132 | """logt. |
| 133 | Log the time of the inside code |
| 134 | |
| 135 | Parameters |
| 136 | ---------- |
| 137 | name : |
| 138 | name |
| 139 | show_start : |
| 140 | show_start |
| 141 | """ |
| 142 | if show_start: |
| 143 | cls.timer_logger.info(f"{name} Begin") |
| 144 | cls.set_time_mark() |
| 145 | try: |
| 146 | yield None |
| 147 | finally: |
| 148 | pass |
| 149 | cls.log_cost_time(info=f"{name} Done") |
| 150 | |
| 151 | |
| 152 | def set_log_with_config(log_config: Dict[Text, Any]): |