home *** CD-ROM | disk | FTP | other *** search
/ ring.yamanashi.ac.jp/pub/pc/freem/action/ / action.zip / a7xpg0_11.zip / a7xpg / src / abagames / util / Logger.d < prev    next >
Text File  |  2003-09-20  |  815b  |  35 lines

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