Skip to content

Commit 92d7a23

Browse files
committed
docker info: fix condition for printing debug information
The daemon collects this information regardless if "debug" is enabled. Print the debugging information if either the daemon, or the client has debug enabled. We should probably improve this logic and print any of these if set (but some special rules are needed for file-descriptors, which may use "-1". Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
1 parent cb1def7 commit 92d7a23

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

cli/command/system/info.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,12 @@ func prettyPrintServerInfo(streams command.Streams, info *info) []error {
313313
fprintln(output, " Docker Root Dir:", info.DockerRootDir)
314314
fprintln(output, " Debug Mode:", info.Debug)
315315

316-
if info.Debug {
316+
// The daemon collects this information regardless if "debug" is
317+
// enabled. Print the debugging information if either the daemon,
318+
// or the client has debug enabled. We should probably improve this
319+
// logic and print any of these if set (but some special rules are
320+
// needed for file-descriptors, which may use "-1".
321+
if info.Debug || debug.IsEnabled() {
317322
fprintln(output, " File Descriptors:", info.NFd)
318323
fprintln(output, " Goroutines:", info.NGoroutines)
319324
fprintln(output, " System Time:", info.SystemTime)

0 commit comments

Comments
 (0)