Class ONAPLogAdapter


  • public class ONAPLogAdapter
    extends Object
    Extensible adapter for cheaply meeting logging obligations using an SLF4J facade.
    • Constructor Detail

      • ONAPLogAdapter

        public ONAPLogAdapter​(org.slf4j.Logger logger)
        Construct adapter.
        Parameters:
        logger - non-null logger.
    • Method Detail

      • unwrap

        public org.slf4j.Logger unwrap()
        Get logger.
        Returns:
        unwrapped logger.
      • entering

        public ONAPLogAdapter entering​(ONAPLogAdapter.RequestAdapter<?> request,
                                       String format,
                                       Object... arguments)
        Report ENTERING marker.
        Parameters:
        request - non-null incoming request (wrapper).
        format - SLF4J format string
        arguments - Optional arguments as referenced in the format string
        Returns:
        this.
      • entering

        public ONAPLogAdapter entering​(javax.servlet.http.HttpServletRequest request)
        Report ENTERING marker.
        Parameters:
        request - non-null incoming request.
        Returns:
        this.
      • entering

        public ONAPLogAdapter entering​(javax.servlet.http.HttpServletRequest request,
                                       String format,
                                       Object... arguments)
      • exiting

        public ONAPLogAdapter exiting()
        Report EXITING marker.
        Returns:
        this.
      • getResponseDescriptor

        public ONAPLogAdapter.ResponseDescriptor getResponseDescriptor()
        Get descriptor, for setting response details.
        Returns:
        non-null descriptor.
      • checkNotNull

        protected static <T> T checkNotNull​(T in)
        Dependency-free nullcheck.
        Type Parameters:
        T - argument (and return) type.
        Parameters:
        in - to be checked.
        Returns:
        input arg.
      • defaultToEmpty

        protected static String defaultToEmpty​(Object in)
        Dependency-free string default.
        Parameters:
        in - to be filtered.
        Returns:
        input string or null.
      • defaultToUUID

        protected static String defaultToUUID​(String in)
        Dependency-free string default.
        Parameters:
        in - to be filtered.
        Returns:
        input string or null.