Index: /code/branches/output/src/libraries/util/Output.h
===================================================================
--- /code/branches/output/src/libraries/util/Output.h	(revision 8776)
+++ /code/branches/output/src/libraries/util/Output.h	(revision 8777)
@@ -40,5 +40,5 @@
     using namespace level;
 
-    inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContext context = context::undefined)
+    inline OutputStream& orxout(OutputLevel level = level::debug_output, OutputContextFunction context = context::undefined)
     {
         static OutputStream stream;
Index: /code/branches/output/src/libraries/util/output/LogWriter.cc
===================================================================
--- /code/branches/output/src/libraries/util/output/LogWriter.cc	(revision 8776)
+++ /code/branches/output/src/libraries/util/output/LogWriter.cc	(revision 8777)
@@ -83,5 +83,5 @@
 
         if (this->bDefaultPath_)
-            OutputManager::getInstance().pushMessage(level::user_info, context::output, "Opening log file " + name);
+            OutputManager::getInstance().pushMessage(level::user_info, context::output(), "Opening log file " + name);
 
         this->file_.open(name.c_str(), std::fstream::out);
@@ -90,5 +90,5 @@
             this->printLine("Log file opened");
         else
-            OutputManager::getInstance().pushMessage(level::user_warning, context::output, "Failed to open log file. File logging disabled.");
+            OutputManager::getInstance().pushMessage(level::user_warning, context::output(), "Failed to open log file. File logging disabled.");
     }
 
@@ -104,5 +104,5 @@
     void LogWriter::setLogPath(const std::string& path)
     {
-        OutputManager::getInstance().pushMessage(level::internal_info, context::output, "Migrating log file from " + this->path_ + "\nto " + path);
+        OutputManager::getInstance().pushMessage(level::internal_info, context::output(), "Migrating log file from " + this->path_ + "\nto " + path);
 
         this->closeFile();
Index: /code/branches/output/src/libraries/util/output/MemoryWriter.cc
===================================================================
--- /code/branches/output/src/libraries/util/output/MemoryWriter.cc	(revision 8776)
+++ /code/branches/output/src/libraries/util/output/MemoryWriter.cc	(revision 8777)
@@ -67,5 +67,5 @@
     {
         OutputManager::getInstance().unregisterListener(this);
-        this->output(level::debug_output, context::undefined, std::vector<std::string>(1, "MemoryWriter disabled, further messages may be lost"));
+        this->output(level::debug_output, context::undefined(), std::vector<std::string>(1, "MemoryWriter disabled, further messages may be lost"));
     }
 }
Index: /code/branches/output/src/libraries/util/output/OutputDefinitions.h
===================================================================
--- /code/branches/output/src/libraries/util/output/OutputDefinitions.h	(revision 8776)
+++ /code/branches/output/src/libraries/util/output/OutputDefinitions.h	(revision 8777)
@@ -58,4 +58,5 @@
 
     typedef uint64_t OutputContext;
+    typedef OutputContext (OutputContextFunction)();
 
     extern _UtilExport OutputContext registerContext(const std::string& name);
@@ -65,9 +66,13 @@
         static const OutputContext all       = 0xFFFFFFFFFFFFFFFF;
         static const OutputContext none      = 0x0000000000000000;
-        static const OutputContext undefined = registerContext("undefined");
 
-        static const OutputContext test1     = registerContext("test1");
-        static const OutputContext test2     = registerContext("test2");
-        static const OutputContext output    = registerContext("output");
+        namespace
+        {
+            OutputContext undefined()   { static OutputContext value = registerContext("undefined");    return value; }
+
+            OutputContext test1()       { static OutputContext value = registerContext("test1");        return value; }
+            OutputContext test2()       { static OutputContext value = registerContext("test2");        return value; }
+            OutputContext output()      { static OutputContext value = registerContext("output");       return value; }
+        }
     }
 }
Index: /code/branches/output/src/libraries/util/output/OutputManager.cc
===================================================================
--- /code/branches/output/src/libraries/util/output/OutputManager.cc	(revision 8776)
+++ /code/branches/output/src/libraries/util/output/OutputManager.cc	(revision 8777)
@@ -180,5 +180,5 @@
     const std::string& OutputManager::getContextName(OutputContext context) const
     {
-        if (context != context::undefined)
+        if (context != context::undefined())
         {
             boost::bimap<OutputContext, std::string>::left_map::const_iterator it = this->contexts_.left.find(context);
@@ -214,5 +214,5 @@
     {
         std::string prefix = this->getLevelName(level) + ": ";
-        if (context != context::undefined)
+        if (context != context::undefined())
         {
             std::string context_name = this->getContextName(context);
Index: /code/branches/output/src/libraries/util/output/OutputStream.cc
===================================================================
--- /code/branches/output/src/libraries/util/output/OutputStream.cc	(revision 8776)
+++ /code/branches/output/src/libraries/util/output/OutputStream.cc	(revision 8777)
@@ -48,10 +48,10 @@
     }
 
-    void OutputStream::setOutputAttributes(OutputLevel level, OutputContext context)
+    void OutputStream::setOutputAttributes(OutputLevel level, OutputContextFunction context)
     {
         this->level_ = level;
-        this->context_ = context;
+        this->context_ = context();
 
-        this->bAcceptsOutput_ = OutputManager::getInstanceAndCreateListeners().acceptsOutput(level, context);
+        this->bAcceptsOutput_ = OutputManager::getInstanceAndCreateListeners().acceptsOutput(this->level_, this->context_);
     }
 }
Index: /code/branches/output/src/libraries/util/output/OutputStream.h
===================================================================
--- /code/branches/output/src/libraries/util/output/OutputStream.h	(revision 8776)
+++ /code/branches/output/src/libraries/util/output/OutputStream.h	(revision 8777)
@@ -47,5 +47,5 @@
             _UtilExport OutputStream();
 
-            void _UtilExport setOutputAttributes(OutputLevel level, OutputContext context);
+            void _UtilExport setOutputAttributes(OutputLevel level, OutputContextFunction context);
 
             template <class T>
