Skip to content

Commit

Permalink
hotfix stable
Browse files Browse the repository at this point in the history
  • Loading branch information
WebFreak001 committed Sep 25, 2023
1 parent e1fcbb8 commit 160afda
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
2 changes: 0 additions & 2 deletions dub.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
{
"name": "unittest",
"mainSourceFile": "source/app.d",
"dflags": ["-checkaction=context"],
"excludedSourceFiles": [
"source/app.d",
"source/served/info.d"
Expand All @@ -45,7 +44,6 @@
"name": "unittest-optimized",
"buildOptions": ["optimize", "debugInfo", "unittests"],
"mainSourceFile": "source/app.d",
"dflags": ["-checkaction=context"],
"excludedSourceFiles": [
"source/app.d",
"source/served/info.d"
Expand Down
2 changes: 1 addition & 1 deletion http/dub.sdl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name "http"
dependency "requests" version="~>1.1.6"
dependency "requests" version="~>2.1.1"
2 changes: 1 addition & 1 deletion http/source/served/http.d
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,6 @@ string humanSize(T)(T bytes) if (isIntegral!T)

if (bytes < 1024)
return text(bytes, " B");
int exp = cast(int)(log2(bytes) / 8); // 8 = log2(1024)
int exp = cast(int)(log2(double(bytes)) / 8); // 8 = log2(1024)
return format!"%.1f %siB"(bytes / cast(float) pow(1024, exp), prefixes[exp - 1]);
}
11 changes: 10 additions & 1 deletion source/app.d
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,11 @@ int main(string[] args)
debug globalLogLevel = LogLevel.trace;
else globalLogLevel = LogLevel.info;

static if (__VERSION__ < 2101)
sharedLog = new FileLogger(io.stderr);
else
sharedLog = (() @trusted => cast(shared) new FileLogger(io.stderr))();

bool printVer;
string[] features;
string[] provides;
Expand All @@ -93,7 +98,11 @@ int main(string[] args)

void setLogFile(string option, string file)
{
sharedLog = new FileLogger(file, LogLevel.all, CreateFolder.no);
auto fileLogger = new FileLogger(file, LogLevel.all, CreateFolder.no);
static if (__VERSION__ < 2101)
sharedLog = fileLogger;
else
sharedLog = (() @trusted => cast(shared) fileLogger)();
}

//dfmt off
Expand Down

0 comments on commit 160afda

Please sign in to comment.