File: log.d

package info (click to toggle)
projectl 1.001.dfsg1-7
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,720 kB
  • ctags: 5
  • sloc: xml: 57; makefile: 32
file content (22 lines) | stat: -rw-r--r-- 518 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module util.log;
private import std.string;
private import std.conv;
private import std.file;
private import std.path;
private import std.cstream;
static const string g_logname = "run.log";
void Log_write(string msg)
{
	std.cstream.dout.writeLine(msg);
	append(g_logname, msg ~ "\n");
}
void Log_write(int msg)
{
	printf("%d\n", msg);
	append(g_logname, to!string(msg) ~ "\n");
}
void Log_write(Exception e)
{
	std.cstream.dout.writeLine(e.toString());
	append(g_logname, e.toString() ~ "\n");
}