Skip to content

Commit

Permalink
Merge pull request #183 from HSLdevcom/171_Add_warning_log_filter
Browse files Browse the repository at this point in the history
#171 - Add warning log filter
  • Loading branch information
e-halinen authored Aug 17, 2023
2 parents 67c41e5 + 9115b1e commit 6a29466
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/renderer/components/HelmetProject/RunLog/RunLog.css
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@

.Log__header-controls {
display: flex;
justify-content: space-between;
justify-content: space-around;
align-content: center;
width: 100%;
}

.Log__header-control {
margin-right: 10px;
width: 100%;
max-width: 25%;
margin: .25rem;
}
.Log__header-control--on {
background-color: #007AC9;
Expand Down
14 changes: 14 additions & 0 deletions src/renderer/components/HelmetProject/RunLog/RunLog.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const RunLog = ({isScenarioRunning, entries, closeRunLog}) => {

const [showUIEVENT, setShowUIEVENT] = useState(true);
const [showINFO, setShowINFO] = useState(true);
const [showWARN, setShowWARN] = useState(true);
const [showERROR, setShowERROR] = useState(true);
const [showDEBUG, setShowDEBUG] = useState(false);

Expand Down Expand Up @@ -33,6 +34,11 @@ const RunLog = ({isScenarioRunning, entries, closeRunLog}) => {
>
ERROR
</button>
<button className={"Log__header-control" + (showWARN ? " Log__header-control--on" : "")}
onClick={(e) => setShowWARN(prevState => !prevState)}
>
WARNING
</button>
<button className={"Log__header-control" + (showDEBUG ? " Log__header-control--on" : "")}
onClick={(e) => setShowDEBUG(prevState => !prevState)}
>
Expand Down Expand Up @@ -81,6 +87,14 @@ const RunLog = ({isScenarioRunning, entries, closeRunLog}) => {
</div>
:
"";

case "WARN":
return showWARN ?
<div className={"Log__entry"} key={entry.id}>
{`[${entry.level}] ${entry.message}`}
</div>
:
"";

default:
return <div className={"Log__entry"} key={entry.id}>
Expand Down

0 comments on commit 6a29466

Please sign in to comment.