Skip to content

Commit 34dd8c1

Browse files
committed
logging stuff
1 parent b1ba910 commit 34dd8c1

File tree

2 files changed

+25
-20
lines changed

2 files changed

+25
-20
lines changed

src/components/App.css

+12-6
Original file line numberDiff line numberDiff line change
@@ -222,21 +222,26 @@ html, body {
222222
height: 100%;
223223
width: 100%;
224224
}
225+
.logger table {
226+
width: 100%;
227+
}
228+
.logger td {
229+
vertical-align: top;
230+
}
225231
.log-messages {
226232
overflow: auto;
227233
height: 100%;
228234
}
229235
.log-messages>* {
230236
overflow-wrap: anywhere;
231-
display: flex;
232237
}
233238
.logger .msg {
234239
flex: 1 1 auto;
235240
}
236241
.logger .file {
237-
float: right;
238-
position: relative;
239242
user-select: none;
243+
white-space: nowrap;
244+
color: var(--link-color);
240245
}
241246
.tooltip {
242247
position: relative;
@@ -278,21 +283,22 @@ html, body {
278283
margin: 0 0.25em 0 0.25em;
279284
background-position: center center;
280285
background-repeat: no-repeat;
281-
text-align: center;
282286
flex: 0 0 auto;
287+
text-align: right;
288+
white-space: nowrap;
289+
user-select: none;
283290
}
284291
.logger .log .count,
285292
.logger .info .count,
286293
.logger .warn .count,
287294
.logger .error .count {
288295
border-radius: 0.5em;
289-
vertical-align: middle;
290-
line-height: 1em;
291296
}
292297

293298
.logger .info .count {
294299
background: #666;
295300
color: #DDD;
301+
color: var(--unselected-color);
296302
}
297303
.logger .warn {
298304
color: var(--warn-fg-color);

src/components/Log.js

+13-14
Original file line numberDiff line numberDiff line change
@@ -105,25 +105,24 @@ export default class Log extends React.Component {
105105
return (
106106
<div className="logger">
107107
<div className="log-messages layout-scrollbar" ref={this.logMessagesRef}>
108+
<table><tbody>
108109
{ logManager.getMsgs().map((msg, ndx) => {
109110
const tooltip = !msg.section;
110111
return (
111-
<div className={classNames('log-line',{[msg.type]: true})} key={`l${ndx}`}>
112-
<div className={msg.count ? "count" : "no-count"}>{msg.count ? msg.count : ''}</div>
113-
<div className="msg">
114-
{msg.msg}
115-
<span>&nbsp;</span> {/* this is to prevent auto-selection to the next element when double clicking */}
116-
<div
117-
className={classNames('file', {tooltip, fileLink: msg.section})}
118-
onClick={() => onGoToLine(msg)}
119-
data-tooltip={`${msg.section || msg.url}:${msg.lineNo}`}
120-
>
121-
{msg.section || basename(msg.url || '')}:{msg.lineNo}
122-
</div>
123-
</div>
124-
</div>
112+
<tr className={classNames('log-line',{[msg.type]: true})} key={`l${ndx}`}>
113+
<td className={msg.count ? "count" : "no-count"}>{msg.count ? msg.count : ''}</td>
114+
<td className="msg">{msg.msg}</td>
115+
<td
116+
className={classNames('file', {tooltip, fileLink: msg.section})}
117+
onClick={() => onGoToLine(msg)}
118+
data-tooltip={`${msg.section || msg.url}:${msg.lineNo}`}
119+
>
120+
{msg.section || basename(msg.url || '')}:{msg.lineNo}
121+
</td>
122+
</tr>
125123
);
126124
})}
125+
</tbody></table>
127126
</div>
128127
</div>
129128
);

0 commit comments

Comments
 (0)