]> Dogcows Code - chaz/yoink/blobdiff - src/moof/log.cc
build system enhancements
[chaz/yoink] / src / moof / log.cc
index e59740dd2a00e487f2ace56cc84839d1e395db98..d0acf2e103334e98c99a562b8688b2f644c0a9aa 100644 (file)
@@ -81,15 +81,24 @@ std::ostream& log(std::cout);
 static std::ofstream null_log_;
 std::ostream& null_log(null_log_);
 
-class log log_error(log::error);
-class log log_warning(log::warning);
-class log log_info(log::info);
-class log log_debug(log::debug);
+
+// These objects are intentionally not deconstructed so that logging will
+// still be available after this module has been cleaned up.
+class log& log_error(*new class log(log::error));
+class log& log_warning(*new class log(log::warning));
+class log& log_info(*new class log(log::info));
+class log& log_debug(*new class log(log::debug));
 
 
 static int log_script(script& script, enum log::level level)
 {
-       static class log* logs[] = {0, &log_error, &log_warning, &log_info, &log_debug};
+       static class log* logs[] = {
+               0,
+               &log_error,
+               &log_warning,
+               &log_info,
+               &log_debug
+       };
 
        script::slot param = script[1];
 
This page took 0.017121 seconds and 4 git commands to generate.