Skip to content
This repository has been archived by the owner on Nov 8, 2024. It is now read-only.

Commit

Permalink
added logfile colors to better distinguish errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamics committed Jul 25, 2022
1 parent 5921f1d commit bc49a04
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions frontend/src/pages/logviewer/containers/systemLog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,16 @@ const SystemLog = () => {
return (
<div className='themeBg themeText'>
{getServerLog.file?.map((log: any, idx: number) => {
// check if first word is error or failed
const errorWords = ['failed', 'error'];
const isError = new RegExp(errorWords.join('|')).test(log?.message.toLowerCase());

return (
<div key={idx} style={{ fontSize: '16px' }}>
<Label color='blue' horizontal>
<Label color={`${isError ? 'red' : 'green'}`} horizontal>
{log.timestamp}
</Label>
{`${log.message}`}
<span style={{ background: `${isError ? '#a1131366' : ''}` }}>{`${log.message}`}</span>
</div>
);
})}
Expand Down

0 comments on commit bc49a04

Please sign in to comment.