const _logToFd = function()

in src/utils/LogPatch.ts [48:62]


const _logToFd = function (logTarget: any) {
  const typeAndLength = Buffer.alloc(8);
  typeAndLength.writeUInt32BE(0xa55a0001, 0);
  typeAndLength.writeUInt32BE(0x00000000, 4);

  return (level: any, message: any) => {
    const time = new Date().toISOString();
    const requestId = _currentRequestId.get();
    const enrichedMessage = `${time}\t${requestId}\t${level.name}\t${message}\n`;
    const messageBytes = Buffer.from(enrichedMessage, "utf8");
    typeAndLength.writeInt32BE(messageBytes.length, 4);
    fs.writeSync(logTarget, typeAndLength);
    fs.writeSync(logTarget, messageBytes);
  };
};