blob: f251d5b7fe94f6727532bac3c996ad05b2034a9a [file] [log] [blame]
Tim Windelschmidt6d33a432025-02-04 14:34:25 +01001// Copyright The Monogon Project Authors.
2// SPDX-License-Identifier: Apache-2.0
3
Serge Bazanski05f813b2023-03-16 17:58:39 +01004package launch
5
6import (
7 "fmt"
Serge Bazanski05f813b2023-03-16 17:58:39 +01008 "strings"
9)
10
Tim Windelschmidtd0cdb572025-03-27 17:18:39 +010011// logf is compatible with the output of ConciseString as used in the Metropolis
Serge Bazanski05f813b2023-03-16 17:58:39 +010012// console log, making the output more readable in unified test logs.
Tim Windelschmidtd0cdb572025-03-27 17:18:39 +010013func logf(f string, args ...any) {
Serge Bazanski05f813b2023-03-16 17:58:39 +010014 formatted := fmt.Sprintf(f, args...)
15 for i, line := range strings.Split(formatted, "\n") {
16 if len(line) == 0 {
17 continue
18 }
19 if i == 0 {
20 fmt.Printf("TT| %20s ! %s\n", "test launch", line)
21 } else {
22 fmt.Printf("TT| %20s | %s\n", "", line)
23 }
24 }
25}