Thanks for your interest and for the answer!
Source of the problemThe
main problem is that the HFS
takes into account the background color of system's GUI elements but
ignores the text color on this background. HFS
should ignore both or respect both. Taking into account only one of these system settings lead to mentioned bug.
General solutionThe best approach would be:
- default to respecting both or none of mentioned system settings and...
- allowing a user to customize highlight colors if they think the default approach (mentioned above) is not sufficient.
Detailed solutionWhen you right-click the log window, the context menu with some options is unrolled. One of these option is
Font.... Why not to provide an additional option like
Colors... or a submenu
Colors with following entries:
- Default background...
- Selection background...
- Default text...
- Date and Time text...
- IP or host name text...
- Dumped headers text...
Extended detailed solutionAbove list is the minimal set of settings of log window colors. The extended list would be as follows:
- Default - background...
- Default - text...
- Default - selection background...
- Default - selection text...
- Date and Time - background...
- Date and Time - text...
- Date and Time - selection background...
- Date and Time - selection text...
- IP or host name - background...
- IP or host name - text...
- IP or host name - selection background...
- IP or host name - selection text...
- Dumped headers - background...
- Dumped headers - text...
- Dumped headers - selection background...
- Dumped headers - selection text...
Outside of the problemThe following issues are only partially related to the mentioned problem.
Ogrammar filesIt would be fine to release "
HFS log"
grammar files for
syntax highlighting in some of the most popular
text editiors and
IDEs like:
- compatible with TextMate language grammars: Sublime Text, TextMate, Atom, and not sure about CudaText and LimeText
- based on Scintilla editing component: Notepad++, Geany, Notepad2, Code::Blocks, Eric Python IDE, CodeLite, Leo (Leonine Editor with Outlines), Komodo Edit, Komodo IDE
- based on CodeMirror editing component: Brackets, Light Table, Codeanywhere
- vim and other based on Vi
- Emacs and other based on Emacs
- others popular: Visual Studio Code, EmEditor, Kate, gedit, PSPad, SlickEdit, Textpad, UltraEdit, Bluefish etc.
It would be sufficient to release only
5 grammar files for most widely used text editing components: TextMate, Scintilla, CodeMirror, Vi, Emacs.
EDIT: It would be sufficient to release only
4 grammar files because of
Textmate grammars support for CodeMirror.
export log to HTMLWhen particular text editor don't support HFS log syntax, then for some people it would be great to be able to
export log to HTML file maintaining syntax highlighting.
Sample log in HTML format:
<html>
<head>
<meta charset="utf-8" />
<title>HFS log from 2020-02-06 16:44:10 to 2020-02-06 16:44:11</title>
<style>
body {
background-color: #000;
color: #fff;
font-family: Fira Code Medium, monospace;
font-weight: 500;
}
body > * {
margin-bottom: 1em;
}
.connections {
}
.request {
}
.request-headers {
margin-left: 2em;
color: #00f;
white-space: pre-line;
}
.request-headers:first-line {
line-height: 0;
}
.time {
display: inline-block;
color: #f00;
}
.address {
color: #080;
white-space: pre;
}
</style>
</head>
<body>
<div class="connections">
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1001</span> Connected
</div>
<div class="request">
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1001</span> Requested GET /someDirectory/someFile.html
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1001</span> Request dump
<div class="request-headers">
GET /someDirectory/someFile.html HTTP/1.1
Host: 12.34.56.78
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT ...) ...
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: HFS_SID_=0.502198243869051
If-Modified-Since: Thu, 06 Feb 2020 16:43:40 GMT
</div>
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1001</span> Not modified, use cache
</div>
<div class="connections">
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1001</span> Disconnected by server - 576 bytes sent
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1002</span> Connected
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1003</span> Connected
</div>
<div class="request">
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1002</span> Requested GET /styles/main_style.css
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1002</span> Request dump
<div class="request-headers">
GET /styles/main_style.css HTTP/1.1
Host: 12.34.56.78
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/css,*/*;q=0.1
If-Modified-Since: Thu, 06 Feb 2020 16:43:56 GMT
User-Agent: Mozilla/5.0 (Windows NT ...) ...
Referer: http://12.34.56.78/someDirectory/someFile.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: HFS_SID_=0.502198243869051
</div>
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1002</span> Served 1.8 K
</div>
<div class="connections">
<span class="time">2020-02-06 16:44:10</span> <span class="address">12.34.56.78:1004</span> Connected
</div>
<div class="request">
<span class="time">2020-02-06 16:44:11</span> <span class="address">12.34.56.78:1003</span> Requested GET /styles/non_existent_file.css
<span class="time">2020-02-06 16:44:11</span> <span class="address">12.34.56.78:1003</span> Request dump
<div class="request-headers">
GET /styles/non_existent_file.css HTTP/1.1
Host: 12.34.56.78
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/css,*/*;q=0.1
User-Agent: Mozilla/5.0 (Windows NT ...) ...
Referer: http://12.34.56.78/someDirectory/someFile.html
Accept-Encoding: gzip, deflate, sdch
Accept-Language: pl-PL,pl;q=0.8,en-US;q=0.6,en;q=0.4
Cookie: HFS_SID_=0.502198243869051
</div>
<span class="time">2020-02-06 16:44:11</span> <span class="address">12.34.56.78:1003</span> Not served: 404 - Not found
</div>
</body>
</html>