Skip to content

Instantly share code, notes, and snippets.

@dbenage-cx
Last active April 12, 2017 21:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbenage-cx/79b1ac68acc6b02425b4211539ad6774 to your computer and use it in GitHub Desktop.
Save dbenage-cx/79b1ac68acc6b02425b4211539ad6774 to your computer and use it in GitHub Desktop.
log example
diff --git a/UI/Sound.cpp b/UI/Sound.cpp
index c6a16e3..e2cc1da 100644
--- a/UI/Sound.cpp
+++ b/UI/Sound.cpp
@@ -11,6 +11,7 @@
#include <AL/al.h>
#endif
+#include <iostream>
#include <vorbis/vorbisfile.h>
#include <map>
@@ -268,6 +269,13 @@ void Sound::Impl::Disable() {
DebugLogger() << "Audio " << (m_initialized ? "enabled." : "disabled.");
}
+namespace {
+ const std::string DoThis(const std::string& txt) {
+ std::cout << "DoThis " << txt << std::endl;
+ return {txt + "This"};
+ }
+}
+
/// Initialize OpenAl and return true on success.
// TODO rewrite with std::unique_ptr and custom deleter to remove long
// chain of "destructor" code.
@@ -279,6 +287,8 @@ void Sound::Impl::InitOpenAL() {
device = alcOpenDevice(nullptr);
+ DebugLogger() << DoThis("Thing");
+
if (!device) {
ErrorLogger() << "Unable to initialise default OpenAL device.";
m_initialized = false;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment