Skip to content

Commit 648e04d

Browse files
committed
add more printing functions in gloomberg
1 parent 7f546c2 commit 648e04d

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

Diff for: internal/nemo/gloomberg/gloomberg.go

+33
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,39 @@ func (gb *Gloomberg) PrMod(mod string, message string) {
173173
gb.printToTerminal(icon, keyword, message)
174174
}
175175

176+
// PrModf formats and prints messages from gloomberg to the terminal.
177+
func (gb *Gloomberg) PrModf(mod string, format string, a ...any) {
178+
gb.PrMod(mod, fmt.Sprintf(format, a...))
179+
}
180+
181+
// PrVMod prints messages from gloomberg to the terminal if verbose mode is enabled.
182+
func (gb *Gloomberg) PrVMod(mod string, message string) {
183+
if viper.GetBool("log.verbose") {
184+
gb.PrMod(mod, message)
185+
}
186+
}
187+
188+
// PrVModf formats and prints messages from gloomberg to the terminal if verbose mode is enabled.
189+
func (gb *Gloomberg) PrVModf(mod string, format string, a ...any) {
190+
if viper.GetBool("log.verbose") {
191+
gb.PrModf(mod, format, a...)
192+
}
193+
}
194+
195+
// PrDMod prints messages from gloomberg to the terminal if debug mode is enabled.
196+
func (gb *Gloomberg) PrDMod(mod string, message string) {
197+
if viper.GetBool("log.debug") {
198+
gb.PrMod(mod, message)
199+
}
200+
}
201+
202+
// PrDModf formats and prints messages from gloomberg to the terminal if debug mode is enabled.
203+
func (gb *Gloomberg) PrDModf(mod string, format string, a ...any) {
204+
if viper.GetBool("log.debug") {
205+
gb.PrModf(mod, format, a...)
206+
}
207+
}
208+
176209
func (gb *Gloomberg) printToTerminal(icon string, keyword string, message string) {
177210
if message == "" {
178211
return

0 commit comments

Comments
 (0)