Skip to content

Commit

Permalink
Fix custom tracing of systemd priority prefixed messages
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasmalacofilho committed Jan 12, 2018
1 parent b98c3a8 commit 0ea0791
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Server.hx
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,11 @@ class Server {
{
var pri = "";
#if systemd
if (msg.charCodeAt(0) == "<") {
var p = msg.indexOf(">", 1);
if (Std.is(msg, String) && (msg:String).charAt(0) == "<") {
var p = (msg:String).indexOf(">", 1);
if (p <= 4) { // the syslog spec allows up to the <191> prefix (even though systemd doesn't)
pri = msg.substr(0, p);
msg = msg.substr(p);
pri = (msg:String).substr(0, p + 1);
msg = (msg:String).substr(p + 1);
}
}
#end
Expand Down

0 comments on commit 0ea0791

Please sign in to comment.