Skip to content

Commit

Permalink
remove imports of std.stdio.writeln and instead use logger
Browse files Browse the repository at this point in the history
  • Loading branch information
SingingBush committed Feb 11, 2023
1 parent 2b7d1f4 commit 27a28bf
Show file tree
Hide file tree
Showing 4 changed files with 158 additions and 137 deletions.
14 changes: 11 additions & 3 deletions source/hibernated/metadata.d
Expand Up @@ -18,7 +18,7 @@ import std.ascii;
import std.conv;
import std.datetime;
import std.exception;
import std.stdio;
//import std.stdio : writeln;
import std.string;
import std.traits;
import std.typecons;
Expand All @@ -44,6 +44,13 @@ static if(__VERSION__ < 2080) {
alias enforceHelper = enforce;
}

// For backwards compatibily (since D 2.101, logger is no longer in std.experimental)
static if (__traits(compiles, (){ import std.logger; } )) {
import std.logger : trace, warning;
} else {
import std.experimental.logger : trace, warning;
}

abstract class EntityMetaData {

@property size_t length();
Expand Down Expand Up @@ -3596,8 +3603,9 @@ class DBInfo {
}
tables = list;
hasCircularRefs = hasCircularReferences();
if (hasCircularRefs)
writeln("has circular references");
if (hasCircularRefs) {
warning("has circular references");
}
}
private bool hasCircularReferences() {
for (int i=0; i<tables.length; i++)
Expand Down

0 comments on commit 27a28bf

Please sign in to comment.