Skip to content

Commit 604f6ba

Browse files
committed
refactor: use fixed-width path in logs
1 parent dfe6b2f commit 604f6ba

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

app/src/main/java/to/bitkit/utils/Logger.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,13 +306,13 @@ private fun formatLog(level: LogLevel, msg: String?, context: String, path: Stri
306306
val timestamp = utcDateFormatterOf(DatePattern.LOG_LINE).format(Date())
307307
val message = msg?.trim().orEmpty()
308308
val contextString = if (context.isNotEmpty()) " - $context" else ""
309+
val location = "[$path:$line]"
309310
return String.format(
310311
Locale.US,
311-
"%s %-7s [%s:%d] %s%s",
312+
"%s %-7s %-36s %s%s",
312313
timestamp,
313314
level.name,
314-
path,
315-
line,
315+
location,
316316
message,
317317
contextString,
318318
)

0 commit comments

Comments
 (0)