]> Dogcows Code - chaz/yoink/blobdiff - src/Moof/Engine.cc
stream-based logging classes
[chaz/yoink] / src / Moof / Engine.cc
index fca5e15423ee1c9b639412deea3f1e380002e6e6..ccfaf81e6d77b0b0b195f4c279a0d183563ac323 100644 (file)
@@ -73,7 +73,8 @@ public:
                {
                        char vdName[128];
                        SDL_VideoDriverName(vdName, sizeof(vdName));
-                       logDebug("initialized SDL; using video driver `%s'", vdName);
+                       logDebug << "initialized SDL; using video driver `"
+                                        << vdName << "'" << std::endl;
                }
 
                if (FE_Init() != 0)
@@ -87,13 +88,15 @@ public:
                if (!mAlDevice || !mAlContext)
                {
                        const char* error = alcGetString(mAlDevice,alcGetError(mAlDevice));
-                       logError("error while creating audio context: %s", error);
+                       logError << "error while creating audio context: "
+                                        << error << std::endl;
                }
                else
                {
                        alcMakeContextCurrent(mAlContext);
-                       logDebug("opened sound device `%s'",
-                                       alcGetString(mAlDevice, ALC_DEFAULT_DEVICE_SPECIFIER));
+                       logDebug << "opened sound device `"
+                                        << alcGetString(mAlDevice, ALC_DEFAULT_DEVICE_SPECIFIER)
+                                        << "'" << std::endl;
                }
 
                // now load the settings the engine needs
@@ -196,7 +199,7 @@ public:
 
                                        if (mPrintFps)
                                        {
-                                               logInfo("%d fps", mFps);
+                                               logInfo << mFps << " fps" << std::endl;
                                        }
                                }
 
@@ -279,7 +282,8 @@ public:
        {
                ASSERT(layer && "cannot push null layer");
                mStack.push_front(layer);
-               logDebug("stack: %d [pushed %X]", mStack.size(), layer.get());
+               logDebug << "stack: " << mStack.size()
+                                << " [pushed " << layer.get() << "]" << std::endl;
                layer->pushed(mInterface);
        }
 
@@ -290,7 +294,8 @@ public:
 
                LayerP layer = mStack.front();
                mStack.pop_front();
-               logDebug("stack: %d [popped %X]", mStack.size(), layer.get());
+               logDebug << "stack: " << mStack.size()
+                                << " [popped " << layer.get() << "]" << std::endl;
                layer->popped(mInterface);
 
                if (fixIt) mStackIt = --mStack.begin();
@@ -319,7 +324,8 @@ public:
                                for (it = layers.begin(); it != layers.end(); ++it)
                                {
                                        (*it)->popped(mInterface);
-                                       logDebug("stack: %d [popped %X]", mStack.size(), (*it).get());
+                                       logDebug << "stack: " << mStack.size()
+                                                        << " [popped " << (*it).get() << "]" << std::endl;
                                }
 
                                if (fixIt) mStackIt = --mStack.begin();
@@ -343,7 +349,8 @@ public:
        {
                if (mMaxFps < mTimestep)
                {
-                       logWarning("capping maximum fps to timestep (%f)", mTimestep);
+                       logWarning << "capping maximum fps to timestep ("
+                                          << mTimestep << ")" << std::endl;
                        mMaxFps = mTimestep;
                }
        }
This page took 0.020713 seconds and 4 git commands to generate.