diff --git a/source/dub/commandline.d b/source/dub/commandline.d index ad92ad8..cbf33d8 100644 --- a/source/dub/commandline.d +++ b/source/dub/commandline.d @@ -672,6 +672,11 @@ override int execute(Dub dub, string[] free_args, string[] app_args) { + // disable all log output and use "writeln" to output the JSON description + auto ll = getLogLevel(); + setLogLevel(LogLevel.none); + scope (exit) setLogLevel(ll); + string package_name; enforceUsage(free_args.length <= 1, "Expected one or zero arguments."); if (free_args.length >= 1) package_name = free_args[1]; diff --git a/source/dub/dub.d b/source/dub/dub.d index 0d734de..ecdc51a 100644 --- a/source/dub/dub.d +++ b/source/dub/dub.d @@ -305,7 +305,9 @@ dst.platform = platform.platform.serializeToJson(); m_project.describe(dst, platform, config); - logInfo("%s", dst.toPrettyString()); + + import std.stdio; + write(dst.toPrettyString()); } diff --git a/source/dub/internal/vibecompat/core/log.d b/source/dub/internal/vibecompat/core/log.d index ddb6274..1b26daa 100644 --- a/source/dub/internal/vibecompat/core/log.d +++ b/source/dub/internal/vibecompat/core/log.d @@ -24,6 +24,11 @@ s_minLevel = level; } +LogLevel getLogLevel() +{ + return s_minLevel; +} + /** Logs a message.