Skip to content

Commit ff46917

Browse files
committed
Removed barely used legacy i18n.Logger.UnformattedFprintln function
1 parent 6b35b87 commit ff46917

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

legacy/builder/i18n/i18n.go

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ var PLACEHOLDER = regexp.MustCompile(`{(\d)}`)
3030

3131
type Logger interface {
3232
Fprintln(w io.Writer, level string, format string, a ...interface{})
33-
UnformattedFprintln(w io.Writer, s string)
3433
UnformattedWrite(w io.Writer, data []byte)
3534
Println(level string, format string, a ...interface{})
3635
Name() string
@@ -53,16 +52,6 @@ func (s *LoggerToCustomStreams) Fprintln(w io.Writer, level string, format strin
5352
fmt.Fprintln(target, Format(format, a...))
5453
}
5554

56-
func (s *LoggerToCustomStreams) UnformattedFprintln(w io.Writer, str string) {
57-
s.mux.Lock()
58-
defer s.mux.Unlock()
59-
target := s.Stdout
60-
if w == os.Stderr {
61-
target = s.Stderr
62-
}
63-
fmt.Fprintln(target, str)
64-
}
65-
6655
func (s *LoggerToCustomStreams) UnformattedWrite(w io.Writer, data []byte) {
6756
s.mux.Lock()
6857
defer s.mux.Unlock()
@@ -89,8 +78,6 @@ type NoopLogger struct{}
8978

9079
func (s NoopLogger) Fprintln(w io.Writer, level string, format string, a ...interface{}) {}
9180

92-
func (s NoopLogger) UnformattedFprintln(w io.Writer, str string) {}
93-
9481
func (s NoopLogger) UnformattedWrite(w io.Writer, data []byte) {}
9582

9683
func (s NoopLogger) Println(level string, format string, a ...interface{}) {}
@@ -111,10 +98,6 @@ func (s AccumulatorLogger) Fprintln(w io.Writer, level string, format string, a
11198
*s.Buffer = append(*s.Buffer, Format(format, a...))
11299
}
113100

114-
func (s AccumulatorLogger) UnformattedFprintln(w io.Writer, str string) {
115-
*s.Buffer = append(*s.Buffer, str)
116-
}
117-
118101
func (s AccumulatorLogger) UnformattedWrite(w io.Writer, data []byte) {
119102
*s.Buffer = append(*s.Buffer, string(data))
120103
}
@@ -144,10 +127,6 @@ func (s HumanTagsLogger) Println(level string, format string, a ...interface{})
144127
s.Fprintln(os.Stdout, level, format, a...)
145128
}
146129

147-
func (s HumanTagsLogger) UnformattedFprintln(w io.Writer, str string) {
148-
fprintln(w, str)
149-
}
150-
151130
func (s HumanTagsLogger) UnformattedWrite(w io.Writer, data []byte) {
152131
write(w, data)
153132
}
@@ -170,10 +149,6 @@ func (s HumanLogger) Println(level string, format string, a ...interface{}) {
170149
s.Fprintln(os.Stdout, level, format, a...)
171150
}
172151

173-
func (s HumanLogger) UnformattedFprintln(w io.Writer, str string) {
174-
fprintln(w, str)
175-
}
176-
177152
func (s HumanLogger) UnformattedWrite(w io.Writer, data []byte) {
178153
write(w, data)
179154
}
@@ -196,10 +171,6 @@ func (s MachineLogger) Println(level string, format string, a ...interface{}) {
196171
printMachineFormattedLogLine(os.Stdout, level, format, a)
197172
}
198173

199-
func (s MachineLogger) UnformattedFprintln(w io.Writer, str string) {
200-
fprintln(w, str)
201-
}
202-
203174
func (s MachineLogger) Flush() string {
204175
return ""
205176
}

legacy/builder/utils/utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ func ExecCommand(ctx *types.Context, command *exec.Cmd, stdout int, stderr int)
183183
}
184184

185185
if ctx.Verbose {
186-
ctx.GetLogger().UnformattedFprintln(os.Stdout, PrintableCommand(command.Args))
186+
ctx.GetLogger().Println("info", "{0}", PrintableCommand(command.Args))
187187
}
188188

189189
if stdout == Capture {

0 commit comments

Comments
 (0)