Report: new functions PutBrownWithPadRawCase() and PutVar()

This commit is contained in:
Celestino Amoroso 2024-02-20 11:29:52 +01:00
parent 67abfa9dae
commit 8a0ef4c3ea

View File

@ -41,6 +41,11 @@ func (rep *Report) Log() logger.VerboseLogger {
return rep.log
}
func (rep *Report) PutBrownWithPadRawCase(name string, value any, fieldSize int) {
name = utils.PadStringRight(name, rep.pad, fieldSize, rep.valueTempl)
rep.log.VerboseBrownf(name, value)
}
func (rep *Report) PutBrownWithPad(name string, value any, fieldSize int) {
name = strings.Title(name)
name = utils.PadStringRight(name, rep.pad, fieldSize, rep.valueTempl)
@ -57,6 +62,10 @@ func (rep *Report) PutParam(name string, value any) {
rep.PutBrownWithPad(name, value, rep.nameFieldSize)
}
func (rep *Report) PutVar(name string, value any) {
rep.PutBrownWithPadRawCase(name, value, rep.nameFieldSize)
}
func (rep *Report) PutParamWithError(name string, err error, value any) {
if err != nil {
tty, _ := rep.log.GetProperty(CONSOLE_LOG_TTY).(*utils.TTYContext)