/** * Creates the version message for the given class using default format. * * @param clazz the class where package will be determiend from. * @return a string representation of the version information. */ public static String createVersionMessage(Class<?> clazz) { return createVersionMessage(clazz, DEFAULT_LOG_VERSION_INFO); } }
/** * Logs version information for the given class, using the default format. * * @param clazz the class where package will be determiend from. */ public static void logVersionInformation(Class<?> clazz) { logVersionInformation(clazz, DEFAULT_LOG_VERSION_INFO); }
/** * By inspecting specified Class, getting package and specification version/implementation version * we write a log message with the provided message format. * * @param clazz the class where package will be determined from. * @param formatPattern the string format. * @param logCategory the category to log against. */ public static void logVersionInformation(Class<?> clazz, String formatPattern, String logCategory) { Logger.getLogger(logCategory) .info(createVersionMessage(clazz, formatPattern)); }
/** * By inspecting specified Class, getting package and specification version/implementation version * we write a log message with the provided message format. * * @param clazz the class where package will be determined from. * @param formatPattern the string format. */ public static void logVersionInformation(Class<?> clazz, String formatPattern) { Logger.getLogger(clazz) .info(createVersionMessage(clazz, formatPattern)); }