java.lang.Object
io.jstach.rainbowgum.RainbowGum.Builder
- Enclosing interface:
RainbowGum
RainbowGum Builder.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds an un-startedRainbowGum
.optional()
For returning an optional for the LogProvider contract.For returning an optional for the LogProvider contract.route
(LogRouter.Router route) Adds a router.route
(String name, Consumer<LogRouter.Router.Builder> consumer) Adds a route by using a consumer of the route builder.route
(Consumer<LogRouter.Router.Builder> consumer) Adds a route by using a consumer of the route builder.set()
Builds, starts and sets the RainbowGum as the global one picked up by logging facades.void
unset()
Removes the currently set Rainbow Gum which will close it if one exists and will be replaced by the default provision process ifRainbowGum.of()
is called beforeset()
.
-
Method Details
-
route
Adds a router.- Parameters:
route
- a router.- Returns:
- builder.
-
route
Adds a route by using a consumer of the route builder.- Parameters:
name
- name of router.consumer
- consumer is passed router builder. The consumer does not need to callLogRouter.Router.builder(String,LogConfig)
- Returns:
- builder.
- See Also:
-
route
Adds a route by using a consumer of the route builder.- Parameters:
consumer
- consumer is passed router builder. The consumer does not need to callLogRouter.Router.builder(String,LogConfig)
- Returns:
- builder.
- See Also:
-
build
Builds an un-startedRainbowGum
.- Returns:
- an un-started
RainbowGum
.
-
set
Builds, starts and sets the RainbowGum as the global one picked up by logging facades.- Returns:
- started and set rainbow that can be used in a try-close.
-
unset
Removes the currently set Rainbow Gum which will close it if one exists and will be replaced by the default provision process ifRainbowGum.of()
is called beforeset()
.- API Note
- This is largely an internal detail for unit testing the provision process.
-
optional
For returning an optional for the LogProvider contract.- Returns:
- optional that always has a rainbow gum.
- API Note
- this method is for ergonomics.
-
optional
For returning an optional for the LogProvider contract.- Parameters:
condition
- condition to check if this rainbow gum should be used.- Returns:
- optional rainbow gum.
- API Note
- this method is for ergonomics.
-