1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
/*
* $Id: Logger.d,v 1.2 2003/09/20 04:04:06 kenta Exp $
*
* Copyright 2003 Kenta Cho. All rights reserved.
*/
module abagames.util.Logger;
import std.stdio;
/**
* Logger(error/info).
*/
public class Logger {
public static void info(string msg) {
stderr.writeln("Info: " ~ msg);
}
public static void error(string msg) {
//stderr.writeln("Error: " ~ msg);
throw new Exception("Error: " ~ msg ~ "\0");
}
public static void error(Exception e) {
//stderr.writeln("Error: " ~ e.toString());
throw new Exception("Error: " ~ e.toString() ~ "\0");
}
public static void error(Error e) {
//stderr.writeln("Error: " ~ e.toString());
//if (e.next)
// error(e.next);
throw new Exception("Error: " ~ e.toString() ~ "\0");
}
}
|