blob: 2637e243fbb9ac0525bd87a1fc6ee109fe6c9a7d [file] [log] [blame]
Serge Bazanski05f813b2023-03-16 17:58:39 +01001package launch
2
3import (
4 "fmt"
5 "os"
6 "strings"
7)
8
9// Log is compatible with the output of ConciseString as used in the Metropolis
10// console log, making the output more readable in unified test logs.
11func Log(f string, args ...any) {
12 formatted := fmt.Sprintf(f, args...)
13 for i, line := range strings.Split(formatted, "\n") {
14 if len(line) == 0 {
15 continue
16 }
17 if i == 0 {
18 fmt.Printf("TT| %20s ! %s\n", "test launch", line)
19 } else {
20 fmt.Printf("TT| %20s | %s\n", "", line)
21 }
22 }
23}
24
25func Fatal(f string, args ...any) {
26 Log(f, args...)
27 os.Exit(1)
28}