Class Banner
java.lang.Object
br.net.dd.netherwingcore.common.Banner
The
Banner class is responsible for displaying a banner message with relevant information
and graphical decorations in the logs whenever an application or service is started.
This class outputs:
- The current version of the application or service, retrieved from
RevisionData. - A graphical banner artwork.
- A message including the service name and additional logging details.
This banner serves as a visual cue indicating that the service has initialized successfully while also providing immediate access to version and logging details.
Usage Example:
Banner.show("MyService", "logs/service.log", "Running in production mode");
This will output the banner in the logs using the provided service name and extra log information.
Dependencies:
This class depends on:RevisionDatafor versioning information.Logfor logging the banner output.
Thread Safety:
This class is not instantiable, and the methodshow is static. It is thread-safe
as it only writes to the logs using static methods.
Limitations:
- The banner artwork is hardcoded and not customizable through parameters.
- No internationalization (i18n) support is provided for the logged messages.
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Banner
public Banner()
-
-
Method Details
-
show
Displays the banner message with the application version, service name, and additional information about logging.The method logs the following in order:
- The full version of the application alongside the service name.
- A message indicating how to stop the application (`Ctrl-C`).
- A graphical ASCII representation of the banner.
- The GitHub repository URL for the project.
- Parameters:
serviceName- the name of the service to display in the banner.logFileName- the name of the log file (currently unused in the method).logExtraInfo- additional information about logging (currently unused in the method).
-