mirror of
https://github.com/hoytech/strfry.git
synced 2025-06-16 16:28:50 +00:00
fix: Clamp Event strings
When an event is rejected because it's too large, the entire event is printed to the log. This floods the log and makes it totally unreadable. So this change clamps it to 200 chars.
This commit is contained in:
@ -1,5 +1,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include<string.h>
|
||||||
#include <hoytech/protected_queue.h>
|
#include <hoytech/protected_queue.h>
|
||||||
|
|
||||||
#include "golpe.h"
|
#include "golpe.h"
|
||||||
@ -71,7 +72,7 @@ struct WriterPipeline {
|
|||||||
try {
|
try {
|
||||||
parseAndVerifyEvent(m.eventJson, secpCtx, verifyMsg, verifyTime, packedStr, jsonStr);
|
parseAndVerifyEvent(m.eventJson, secpCtx, verifyMsg, verifyTime, packedStr, jsonStr);
|
||||||
} catch (std::exception &e) {
|
} catch (std::exception &e) {
|
||||||
if (verboseReject) LW << "Rejected event: " << m.eventJson << " reason: " << e.what();
|
if (verboseReject) LW << "Rejected event: " << m.eventJson.get_string().substr(0,200) << " reason: " << e.what();
|
||||||
numLive--;
|
numLive--;
|
||||||
totalRejected++;
|
totalRejected++;
|
||||||
continue;
|
continue;
|
||||||
|
Reference in New Issue
Block a user