mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
feat(logs): show full log event (#1096)
* feat(logs): show all extra fields in UI * feat(logs): init log level as debug then trace
This commit is contained in:
parent
7b77ff766e
commit
cbf668e87c
6 changed files with 448 additions and 88 deletions
|
@ -31,14 +31,16 @@ type LogEvent = {
|
|||
message: string;
|
||||
};
|
||||
|
||||
type LogLevel = "TRACE" | "DEBUG" | "INFO" | "ERROR" | "WARN";
|
||||
type LogLevel = "TRC" | "DBG" | "INF" | "ERR" | "WRN" | "FTL" | "PNC";
|
||||
|
||||
const LogColors: Record<LogLevel, string> = {
|
||||
"TRACE": "text-purple-300",
|
||||
"DEBUG": "text-yellow-500",
|
||||
"INFO": "text-green-500",
|
||||
"ERROR": "text-red-500",
|
||||
"WARN": "text-yellow-500"
|
||||
"TRC": "text-purple-300",
|
||||
"DBG": "text-yellow-500",
|
||||
"INF": "text-green-500",
|
||||
"ERR": "text-red-500",
|
||||
"WRN": "text-yellow-500",
|
||||
"FTL": "text-red-500",
|
||||
"PNC": "text-red-600",
|
||||
};
|
||||
|
||||
export const Logs = () => {
|
||||
|
@ -143,7 +145,7 @@ export const Logs = () => {
|
|||
title={entry.time}
|
||||
className="font-mono text-gray-500 dark:text-gray-600 mr-2 h-full"
|
||||
>
|
||||
{format(new Date(entry.time), "HH:mm:ss.SSS")}
|
||||
{format(new Date(entry.time), "HH:mm:ss")}
|
||||
</span>
|
||||
{entry.level in LogColors ? (
|
||||
<span
|
||||
|
@ -153,7 +155,6 @@ export const Logs = () => {
|
|||
)}
|
||||
>
|
||||
{entry.level}
|
||||
{" "}
|
||||
</span>
|
||||
) : null}
|
||||
<span className="ml-2 text-black dark:text-gray-300">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue