Class AuditEventDefaultFormatter

  • All Implemented Interfaces:
    AuditEventFormatter

    public class AuditEventDefaultFormatter
    extends Object
    implements AuditEventFormatter
    Represents the default formatter for log message. Default log message format is: [SEVERITY LEVEL] filePath:lineNo:columnNo: message. [CheckName] When the module id of the message has been set, the format is: [SEVERITY LEVEL] filePath:lineNo:columnNo: message. [ModuleId]
    • Method Detail

      • calculateBufferLength

        private static int calculateBufferLength​(AuditEvent event,
                                                 int severityLevelNameLength)
        Returns the length of the buffer for StringBuilder. bufferLength = fileNameLength + messageLength + lengthOfAllSeparators + + severityNameLength + checkNameLength.
        Parameters:
        event - audit event.
        severityLevelNameLength - length of severity level name.
        Returns:
        the length of the buffer for StringBuilder.
      • getCheckShortName

        private static String getCheckShortName​(AuditEvent event)
        Returns check name without 'Check' suffix.
        Parameters:
        event - audit event.
        Returns:
        check name without 'Check' suffix.