Today is the second day of the year! Happy New Year to all of you

First leave a suspense to the small companions hey hey article at the end of the mysterious code ~ (you can guess why to drop first!)

Hey hey I don’t know how the Chinese New Year these two days you ~

Such as

How many red envelopes did the Spring Festival Gala get? ๐Ÿ˜„

Do you celebrate the New Year with someone you like? ใƒพ(โ‰งโ–ฝโ‰ฆ*)o ๐Ÿ˜

Eat tired of big fish big meat not ~ ๐Ÿ˜„

Began to learn to have ๐Ÿ˜Š

Take five to kill no ๐Ÿ˜œ

Of course, at least by the time you read this article, you have already learned a little bit

Here we go

Year of the Ox ~ how we also study how to give us drop IDEA to add point drop atmosphere, like this

Spring Boot source Banner

Source code looks <(~) ~)โ†—[GO!

When Springboot starts, a SpringApplication object is created.

SpringApplicationThe constructor

Specifies the mode for the banner

BannerFunctional interface

There are three patterns

runmethods

Create a banner object

Enter the above red box, you can see here if not OFF patterns to create SpringApplicationBannerPrinter object

As you can see, the class also defines the image type (GIF is also supported!). ~ ๐Ÿ˜

Moving on to the source code below, you can see that the only difference here is the output stream, which is printed to the console or log file

return this.bannerMode == Mode.LOG ? bannerPrinter.print(environment, this.mainApplicationClass, logger) : bannerPrinter.print(environment, this.mainApplicationClass, System.out);
Copy the code

printThe source code

To get the Banner

getBannerThe source code

To get the Banner

getImageBannerThe source code

GIF, JPG and PNG will be searched in sequence

The image path can also be configured by itself. The default path is in the Resources folder ~

I don’t know if there are any friends who are curious about how this banner. GIF will print out

4ye here made a GIF with only three frames (too many frames will print endless hahaha ๐Ÿ˜) the effect is ~

The second day, hello cow!

Java4ye A little white blogger focused on productivity ~(increasing groping time), sharing learning resources, technological awareness, little things about programmer life let us groping together ~(โ— world twentyconsciousness) Java4ye here to prepare a series of learning resources for you, as well as a variety of plug-ins, software oh welcome message! Thanks for your support! O (โ‰ง ใƒพ del โ‰ฆ *)