A Printer can can return a new counter or print messages at different log levels. It must be safe to call its methods from concurrent goroutines.
| 6 | // at different log levels. |
| 7 | // It must be safe to call its methods from concurrent goroutines. |
| 8 | type Printer interface { |
| 9 | // NewCounter returns a new progress counter. It is not shown if --quiet or --json is specified. |
| 10 | NewCounter(description string) *Counter |
| 11 | // NewCounterTerminalOnly returns a new progress counter that is only shown if stdout points to a |
| 12 | // terminal. It is not shown if --quiet or --json is specified. |
| 13 | NewCounterTerminalOnly(description string) *Counter |
| 14 | |
| 15 | // E reports an error. This message is always printed to stderr. |
| 16 | // Appends a newline if not present. |
| 17 | E(msg string, args ...interface{}) |
| 18 | // S prints a message, this is should only be used for very important messages |
| 19 | // that are not errors. The message is even printed if --quiet is specified. |
| 20 | // Appends a newline if not present. |
| 21 | S(msg string, args ...interface{}) |
| 22 | // PT prints a message if verbosity >= 1 (neither --quiet nor --verbose is specified) |
| 23 | // and stdout points to a terminal. |
| 24 | // This is used for informational messages. |
| 25 | PT(msg string, args ...interface{}) |
| 26 | // P prints a message if verbosity >= 1 (neither --quiet nor --verbose is specified), |
| 27 | // this is used for normal messages which are not errors. Appends a newline if not present. |
| 28 | P(msg string, args ...interface{}) |
| 29 | // V prints a message if verbosity >= 2 (equivalent to --verbose), this is used for |
| 30 | // verbose messages. Appends a newline if not present. |
| 31 | V(msg string, args ...interface{}) |
| 32 | // VV prints a message if verbosity >= 3 (equivalent to --verbose=2), this is used for |
| 33 | // debug messages. Appends a newline if not present. |
| 34 | VV(msg string, args ...interface{}) |
| 35 | } |
| 36 | |
| 37 | // NoopPrinter discards all messages |
| 38 | type NoopPrinter struct{} |
no outgoing calls
no test coverage detected