Browse Source

New formating for the stanza debug logs, easier to copy/paste

pull/1373/head
Timothée Jaussoin 12 months ago
parent
commit
0e12fe94eb
  1. 8
      linker.php

8
linker.php

@ -71,9 +71,9 @@ function writeOut($msg = null)
}
}
function logOut($log)
function logOut($log, string $type = 'system')
{
fwrite(STDERR, colorize(getenv('sid'), 'yellow') . " : " . $log . "\n");
fwrite(STDERR, colorize(getenv('sid'), 'turquoise') . ' ' . colorize($type, 'purple'). " \n" . $log . "\n");
}
function writeXMPP($xml)
@ -86,7 +86,7 @@ function writeXMPP($xml)
$xmppSocket->write(trim($xml));
if (config('daemon.debug')) {
logOut(colorize(trim($xml) . ' ', 'yellow') . colorize('sent to XMPP', 'green'));
logOut(colorize(trim($xml) . ' ', 'yellow'), '>>> XMPP sent');
}
}
}
@ -287,7 +287,7 @@ $xmppBehaviour = function (React\Socket\Connection $stream) use (&$xmppSocket, $
if (!empty($message)) {
if (config('daemon.debug')) {
logOut(colorize($message . ' ', 'yellow') . colorize('received', 'green'));
logOut(colorize($message . ' ', 'yellow'), '<<< XMPP received');
}
if ($message == '</stream:stream>') {

Loading…
Cancel
Save