/** * Retrieve logging information in the logging context. * * @param cls The class destined to hold this logging information * * @return the logging information in the logging context * * @see LogBlock */ public static LogInfo retrieve(Class cls) { RequestLog requestLog = RLOG.get(); if (requestLog == null) { String message = String.format( "Attempted to retrieve log info while request log object was uninitialized: %s", cls.getSimpleName() ); LOG.error(message); throw new IllegalStateException(message); } LogInfo logInfo = requestLog.info.get(cls.getSimpleName()); if (logInfo == null) { String message = ErrorMessageFormat.RESOURCE_RETRIEVAL_FAILURE.format(cls.getSimpleName()); LOG.error(message); throw new IllegalStateException(message); } return logInfo; }