107 def format(self, record: logging.LogRecord) -> logging.LogRecord:
108 """Apply the correct formatting to the log record."""
109 record.asctime = self.formatTime(record, self.datefmt)
110
111 component_width = 30
112 file_lineno = f"{record.filename}:{record.lineno}"
113 record.filename = file_lineno.ljust(component_width)[:component_width]
114 component_width = 45
115 name_colon = f"{record.name}:"
116 if name_colon.startswith("drunc."):
117 name_colon = name_colon.replace("drunc.", "")
118 record.name = name_colon.ljust(component_width)[:component_width]
119 component_width = 10
120 level_name = record.levelname
121 record.levelname = level_name.ljust(component_width)[:component_width]
122 return super().format(record)
123
124