File: Logger.d

package info (click to toggle)
a7xpg 0.11.dfsg1-10
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 4,864 kB
  • sloc: xml: 56; makefile: 28
file content (34 lines) | stat: -rw-r--r-- 810 bytes parent folder | download | duplicates (3)
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");
  }
}