diff gen/logger.cpp @ 131:5825d48b27d1 trunk

[svn r135] * Merged DMD 1.025 * * Fixed a minor linking order mishap * * Added an command line option -annotate * * Fixed some problems with running optimizations * * Added std.stdio and dependencies to lphobos (still not 100% working, but compiles and links) * * Fixed problems with passing aggregate types to variadic functions * * Added initial code towards full GC support, currently based on malloc and friends, not all the runtime calls the GC yet for memory * * Fixed problems with resolving nested function context pointers for some heavily nested cases * * Redid function argument passing + other minor code cleanups, still lots to do on this end... *
author lindquist
date Fri, 04 Jan 2008 01:38:42 +0100
parents 027b8d8b71ec
children 1700239cab2e
line wrap: on
line diff
--- a/gen/logger.cpp	Fri Dec 28 23:52:40 2007 +0100
+++ b/gen/logger.cpp	Fri Jan 04 01:38:42 2008 +0100
@@ -13,30 +13,30 @@
     static std::string indent_str;
     static std::ofstream null_out("/dev/null");
 
-    static bool enabled = false;
+    static bool _enabled = false;
     void indent()
     {
-        if (enabled) {
+        if (_enabled) {
             indent_str += "* ";
         }
     }
     void undent()
     {
-        if (enabled) {
+        if (_enabled) {
             assert(!indent_str.empty());
             indent_str.resize(indent_str.size()-2);
         }
     }
     std::ostream& cout()
     {
-        if (enabled)
+        if (_enabled)
             return std::cout << indent_str;
         else
             return null_out;
     }
     void println(const char* fmt,...)
     {
-        if (enabled) {
+        if (_enabled) {
             printf(indent_str.c_str());
             va_list va;
             va_start(va,fmt);
@@ -47,7 +47,7 @@
     }
     void print(const char* fmt,...)
     {
-        if (enabled) {
+        if (_enabled) {
             printf(indent_str.c_str());
             va_list va;
             va_start(va,fmt);
@@ -57,11 +57,15 @@
     }
     void enable()
     {
-        enabled = true;
+        _enabled = true;
     }
     void disable()
     {
-        enabled = false;
+        _enabled = false;
+    }
+    bool enabled()
+    {
+        return _enabled;
     }
     void attention(const char* fmt,...)
     {