Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ if %githashsize% == 0 (
move /y bin\githash_.txt bin\githash.txt
)

set DFLAGS=-O -release -version=StdLoggerDisableWarning -Jbin %MFLAGS%
set TESTFLAGS=-g -w -version=StdLoggerDisableWarning -Jbin
set DFLAGS=-O -release -Jbin %MFLAGS%
set TESTFLAGS=-g -w -Jbin
set CORE=
set LIBDPARSE=
set STD=
Expand Down
3 changes: 1 addition & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
"license" : "BSL-1.0",
"targetType" : "autodetect",
"versions" : [
"built_with_dub",
"StdLoggerDisableWarning"
"built_with_dub"
],
"dependencies": {
"libdparse": ">=0.21.1 <0.23.0",
Expand Down
9 changes: 6 additions & 3 deletions makefile
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ INCLUDE_PATHS = \
-Ilibddoc/src \
-Ilibddoc/common/source

DMD_VERSIONS = -version=StdLoggerDisableWarning
# e.g. "-version=MyCustomVersion"
DMD_VERSIONS =
DMD_DEBUG_VERSIONS = -version=dparse_verbose
LDC_VERSIONS = -d-version=StdLoggerDisableWarning
# e.g. "-d-version=MyCustomVersion"
LDC_VERSIONS =
LDC_DEBUG_VERSIONS = -d-version=dparse_verbose
GDC_VERSIONS = -fversion=StdLoggerDisableWarning
# e.g. "-fversion=MyCustomVersion"
GDC_VERSIONS =
GDC_DEBUG_VERSIONS = -fversion=dparse_verbose

DC_FLAGS += -Jbin
Expand Down
18 changes: 18 additions & 0 deletions src/dscanner/analysis/run.d
Original file line number Diff line number Diff line change
Expand Up @@ -610,3 +610,21 @@ MessageSet analyze(string fileName, const Module m, const StaticAnalysisConfig a

return set;
}

version (unittest)
{
shared static this()
{
// mute dsymbol warnings in tests
static if (__VERSION__ >= 2_101_0)
{
import std.logger : sharedLog, LogLevel;
sharedLog.globalLogLevel = LogLevel.error;
}
else
{
import std.experimental.logger : globalLogLevel, LogLevel;
globalLogLevel = LogLevel.error;
}
}
}
20 changes: 19 additions & 1 deletion src/dscanner/main.d
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ else
string[] importPaths;
bool printVersion;
bool explore;
bool verbose;
string errorFormat;

try
Expand Down Expand Up @@ -100,7 +101,9 @@ else
"muffinButton", &muffin,
"explore", &explore,
"skipTests", &skipTests,
"errorFormat|f", &errorFormat);
"errorFormat|f", &errorFormat,
"verbose|v", &verbose
);
//dfmt on
}
catch (ConvException e)
Expand All @@ -114,6 +117,21 @@ else
return 1;
}

{
static if (__VERSION__ >= 2_101_0)
import std.logger : sharedLog, LogLevel;
else
import std.experimental.logger : globalLogLevel, LogLevel;
// we don't use std.logger, but dsymbol does, so we surpress all
// messages that aren't errors from it by default
// users can use verbose to enable all logs (this will log things like
// dsymbol couldn't find some modules due to wrong import paths)
static if (__VERSION__ >= 2_101_0)
sharedLog.globalLogLevel = verbose ? LogLevel.all : LogLevel.error;
else
globalLogLevel = verbose ? LogLevel.all : LogLevel.error;
}

if (muffin)
{
stdout.writeln(` ___________
Expand Down