mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 01:39:21 +02:00
feat(demo): color logcat output by priority
This commit is contained in:
parent
080b77cba5
commit
ee6fda537b
1 changed files with 36 additions and 1 deletions
|
@ -71,6 +71,25 @@ const useClasses = makeStyles({
|
|||
cursor: "default",
|
||||
...shorthands.overflow("hidden"),
|
||||
},
|
||||
// Android Studio Classic Light theme
|
||||
rowVerbose: {
|
||||
color: "#000000",
|
||||
},
|
||||
rowDebug: {
|
||||
color: "#000000",
|
||||
},
|
||||
rowInfo: {
|
||||
color: "#000000",
|
||||
},
|
||||
rowWarn: {
|
||||
color: "#645607",
|
||||
},
|
||||
rowError: {
|
||||
color: "#CD0000",
|
||||
},
|
||||
rowFatal: {
|
||||
color: "#CD0000",
|
||||
},
|
||||
});
|
||||
|
||||
export interface Column extends GridColumn {
|
||||
|
@ -717,6 +736,21 @@ const Header = observer(function Header({
|
|||
);
|
||||
});
|
||||
|
||||
const PRIORITY_COLORS: Record<
|
||||
AndroidLogPriority,
|
||||
keyof ReturnType<typeof useClasses>
|
||||
> = {
|
||||
[AndroidLogPriority.Default]: "rowVerbose",
|
||||
[AndroidLogPriority.Unknown]: "rowVerbose",
|
||||
[AndroidLogPriority.Silent]: "rowVerbose",
|
||||
[AndroidLogPriority.Verbose]: "rowVerbose",
|
||||
[AndroidLogPriority.Debug]: "rowDebug",
|
||||
[AndroidLogPriority.Info]: "rowInfo",
|
||||
[AndroidLogPriority.Warn]: "rowWarn",
|
||||
[AndroidLogPriority.Error]: "rowError",
|
||||
[AndroidLogPriority.Fatal]: "rowFatal",
|
||||
};
|
||||
|
||||
const Row = observer(function Row({
|
||||
className,
|
||||
rowIndex,
|
||||
|
@ -738,7 +772,8 @@ const Row = observer(function Row({
|
|||
className={mergeClasses(
|
||||
className,
|
||||
classes.row,
|
||||
state.selection.has(rowIndex) && classes.selected
|
||||
state.selection.has(rowIndex) && classes.selected,
|
||||
classes[PRIORITY_COLORS[state.list[rowIndex]!.priority]]
|
||||
)}
|
||||
onPointerDown={handlePointerDown}
|
||||
{...rest}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue