Mercurial > projects > ldc
comparison gen/logger.cpp @ 132:1700239cab2e trunk
[svn r136] MAJOR UNSTABLE UPDATE!!!
Initial commit after moving to Tango instead of Phobos.
Lots of bugfixes...
This build is not suitable for most things.
author | lindquist |
---|---|
date | Fri, 11 Jan 2008 17:57:40 +0100 |
parents | 5825d48b27d1 |
children | b604c56945b0 |
comparison
equal
deleted
inserted
replaced
131:5825d48b27d1 | 132:1700239cab2e |
---|---|
3 #include <cstdio> | 3 #include <cstdio> |
4 #include <cstdlib> | 4 #include <cstdlib> |
5 #include <iostream> | 5 #include <iostream> |
6 #include <fstream> | 6 #include <fstream> |
7 #include <string> | 7 #include <string> |
8 | |
9 #include "mars.h" | |
8 | 10 |
9 #include "gen/logger.h" | 11 #include "gen/logger.h" |
10 | 12 |
11 namespace Logger | 13 namespace Logger |
12 { | 14 { |
65 } | 67 } |
66 bool enabled() | 68 bool enabled() |
67 { | 69 { |
68 return _enabled; | 70 return _enabled; |
69 } | 71 } |
70 void attention(const char* fmt,...) | 72 void attention(const Loc& loc, const char* fmt,...) |
71 { | 73 { |
72 printf("***ATTENTION*** "); | 74 printf("***ATTENTION***: %s: ", loc.toChars()); |
73 va_list va; | 75 va_list va; |
74 va_start(va,fmt); | 76 va_start(va,fmt); |
75 vprintf(fmt,va); | 77 vprintf(fmt,va); |
76 va_end(va); | 78 va_end(va); |
77 printf("\n"); | 79 printf("\n"); |