| Tim Windelschmidt | 6d33a43 | 2025-02-04 14:34:25 +0100 | [diff] [blame] | 1 | // Copyright The Monogon Project Authors. |
| 2 | // SPDX-License-Identifier: Apache-2.0 |
| 3 | |
| Serge Bazanski | 05f813b | 2023-03-16 17:58:39 +0100 | [diff] [blame] | 4 | package launch |
| 5 | |
| 6 | import ( |
| 7 | "fmt" |
| Serge Bazanski | 05f813b | 2023-03-16 17:58:39 +0100 | [diff] [blame] | 8 | "strings" |
| 9 | ) |
| 10 | |
| Tim Windelschmidt | d0cdb57 | 2025-03-27 17:18:39 +0100 | [diff] [blame^] | 11 | // logf is compatible with the output of ConciseString as used in the Metropolis |
| Serge Bazanski | 05f813b | 2023-03-16 17:58:39 +0100 | [diff] [blame] | 12 | // console log, making the output more readable in unified test logs. |
| Tim Windelschmidt | d0cdb57 | 2025-03-27 17:18:39 +0100 | [diff] [blame^] | 13 | func logf(f string, args ...any) { |
| Serge Bazanski | 05f813b | 2023-03-16 17:58:39 +0100 | [diff] [blame] | 14 | 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 | } |