Windows!
This commit is contained in:
parent
07c93758f7
commit
5cba44be86
|
@ -1,2 +1,3 @@
|
||||||
dmd -wi client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -ofdcd-client -L/exet:nt/su:windows:4.0
|
dmd client.d messages.d msgpack-d/src/msgpack.d -Imsgpack-d/src -release -inline -noboundscheck -O -ofdcd-client -wi -L/exet:nt/su:windows:4.0
|
||||||
dmd -wi -g server.d modulecache.d actypes.d messages.d constants.d acvisitor.d autocomplete.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d dscanner/formatter.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner/ -ofdcd-server
|
dmd actypes.d astconverter.d autocomplete.d constants.d messages.d modulecache.d semantic.d server.d stupidlog.d dscanner/stdx/d/ast.d dscanner/stdx/d/parser.d dscanner/stdx/d/lexer.d dscanner/stdx/d/entities.d dscanner/formatter.d msgpack-d/src/msgpack.d -Imsgpack-d/src -Idscanner -wi -g -ofdcd-server
|
||||||
|
|
||||||
|
|
57
stupidlog.d
57
stupidlog.d
|
@ -36,37 +36,70 @@ struct Log
|
||||||
static void trace(T...)(T args)
|
static void trace(T...)(T args)
|
||||||
{
|
{
|
||||||
if (level < LogLevel.trace) return;
|
if (level < LogLevel.trace) return;
|
||||||
if (output is stdout)
|
version(Windows)
|
||||||
output.writeln("[\033[01;36mtrace\033[0m] ", args);
|
{
|
||||||
else
|
|
||||||
output.writeln("[trace] ", args);
|
output.writeln("[trace] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (output is stdout)
|
||||||
|
output.writeln("[\033[01;36mtrace\033[0m] ", args);
|
||||||
|
else
|
||||||
|
output.writeln("[trace] ", args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void info(T...)(T args)
|
static void info(T...)(T args)
|
||||||
{
|
{
|
||||||
if (level < LogLevel.info) return;
|
if (level < LogLevel.info) return;
|
||||||
if (output is stdout)
|
version (Windows)
|
||||||
output.writeln("[\033[01;32minfo\033[0m ] ", args);
|
{
|
||||||
else
|
|
||||||
output.writeln("[info ] ", args);
|
output.writeln("[info ] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (output is stdout)
|
||||||
|
output.writeln("[\033[01;32minfo\033[0m ] ", args);
|
||||||
|
else
|
||||||
|
output.writeln("[info ] ", args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void error(T...)(T args)
|
static void error(T...)(T args)
|
||||||
{
|
{
|
||||||
if (level < LogLevel.error) return;
|
if (level < LogLevel.error) return;
|
||||||
if (output is stdout)
|
version(Windows)
|
||||||
output.writeln("[\033[01;31merror\033[0m] ", args);
|
{
|
||||||
else
|
|
||||||
output.writeln("[error] ", args);
|
output.writeln("[error] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (output is stdout)
|
||||||
|
output.writeln("[\033[01;31merror\033[0m] ", args);
|
||||||
|
else
|
||||||
|
output.writeln("[error] ", args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void fatal(T...)(T args)
|
static void fatal(T...)(T args)
|
||||||
{
|
{
|
||||||
if (output is stdout)
|
version(Windows)
|
||||||
output.writeln("[\033[01;35mfatal\033[0m] ", args);
|
{
|
||||||
else
|
|
||||||
output.writeln("[fatal] ", args);
|
output.writeln("[fatal] ", args);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (output is stdout)
|
||||||
|
output.writeln("[\033[01;35mfatal\033[0m] ", args);
|
||||||
|
else
|
||||||
|
output.writeln("[fatal] ", args);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static LogLevel level;
|
static LogLevel level;
|
||||||
static File output;
|
static File output;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue