diff options
author | Chris Robinson <[email protected]> | 2019-06-04 01:37:36 -0700 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2019-06-04 01:37:36 -0700 |
commit | 4522a51ea21813de9a59dd059c50f85d8a5116f1 (patch) | |
tree | dc41f36517a4ec6236c56b375eb37eadee8bf2e6 | |
parent | f0bc9d8a9b45a86cf0736a3f118b28ae6fdb90f0 (diff) |
Don't log the function or prefix
It's ultimately unnecessary since the message is an indicator about where it
was logged from. The message itself is generally more important than where it
was from, too.
-rw-r--r-- | Alc/alc.cpp | 14 | ||||
-rw-r--r-- | Alc/alcontext.h | 1 | ||||
-rw-r--r-- | Alc/backends/alsa.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/coreaudio.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/dsound.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/jack.cpp | 1 | ||||
-rw-r--r-- | Alc/backends/null.cpp | 1 | ||||
-rw-r--r-- | Alc/backends/opensl.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/oss.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/portaudio.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/pulseaudio.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/qsa.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/sdl2.cpp | 1 | ||||
-rw-r--r-- | Alc/backends/sndio.cpp | 2 | ||||
-rw-r--r-- | Alc/backends/solaris.cpp | 1 | ||||
-rw-r--r-- | Alc/backends/wasapi.cpp | 4 | ||||
-rw-r--r-- | Alc/backends/wave.cpp | 1 | ||||
-rw-r--r-- | Alc/backends/winmm.cpp | 2 | ||||
-rw-r--r-- | Alc/helpers.cpp | 12 | ||||
-rw-r--r-- | Alc/hrtf.cpp | 4 | ||||
-rw-r--r-- | Alc/hrtf.h | 1 | ||||
-rw-r--r-- | Alc/logging.h | 13 | ||||
-rw-r--r-- | OpenAL32/Include/alMain.h | 1 | ||||
-rw-r--r-- | OpenAL32/alAuxEffectSlot.cpp | 4 |
24 files changed, 23 insertions, 56 deletions
diff --git a/Alc/alc.cpp b/Alc/alc.cpp index 6ade082e..8378673d 100644 --- a/Alc/alc.cpp +++ b/Alc/alc.cpp @@ -811,7 +811,7 @@ std::atomic<ALCenum> LastNullDeviceError{ALC_NO_ERROR}; void ReleaseThreadCtx(ALCcontext *context) { auto ref = DecrementRef(&context->ref); - TRACEREF("%p decreasing refcount to %u\n", context, ref); + TRACEREF("ALCcontext %p decreasing refcount to %u\n", context, ref); ERR("Context %p current for thread being destroyed, possible leak!\n", context); } @@ -2206,7 +2206,7 @@ ALCdevice::ALCdevice(DeviceType type) : Type{type} */ ALCdevice::~ALCdevice() { - TRACE("%p\n", this); + TRACE("Freeing device %p\n", this); Backend = nullptr; @@ -2240,13 +2240,13 @@ ALCdevice::~ALCdevice() static void ALCdevice_IncRef(ALCdevice *device) { auto ref = IncrementRef(&device->ref); - TRACEREF("%p increasing refcount to %u\n", device, ref); + TRACEREF("ALCdevice %p increasing refcount to %u\n", device, ref); } static void ALCdevice_DecRef(ALCdevice *device) { auto ref = DecrementRef(&device->ref); - TRACEREF("%p decreasing refcount to %u\n", device, ref); + TRACEREF("ALCdevice %p decreasing refcount to %u\n", device, ref); if(UNLIKELY(ref == 0)) delete device; } @@ -2370,7 +2370,7 @@ static ALvoid InitContext(ALCcontext *Context) */ ALCcontext::~ALCcontext() { - TRACE("%p\n", this); + TRACE("Freeing context %p\n", this); ALcontextProps *cprops{Update.exchange(nullptr, std::memory_order_relaxed)}; if(cprops) @@ -2533,13 +2533,13 @@ static bool ReleaseContext(ALCcontext *context, ALCdevice *device) static void ALCcontext_IncRef(ALCcontext *context) { auto ref = IncrementRef(&context->ref); - TRACEREF("%p increasing refcount to %u\n", context, ref); + TRACEREF("ALCcontext %p increasing refcount to %u\n", context, ref); } void ALCcontext_DecRef(ALCcontext *context) { auto ref = DecrementRef(&context->ref); - TRACEREF("%p decreasing refcount to %u\n", context, ref); + TRACEREF("ALCcontext %p decreasing refcount to %u\n", context, ref); if(UNLIKELY(ref == 0)) delete context; } diff --git a/Alc/alcontext.h b/Alc/alcontext.h index 2c4ad1d3..769847f8 100644 --- a/Alc/alcontext.h +++ b/Alc/alcontext.h @@ -147,7 +147,6 @@ struct ALCcontext { ALCcontext& operator=(const ALCcontext&) = delete; ~ALCcontext(); - static constexpr inline const char *CurrentPrefix() noexcept { return "ALCcontext::"; } DEF_NEWDEL(ALCcontext) }; diff --git a/Alc/backends/alsa.cpp b/Alc/backends/alsa.cpp index a2937658..eee89b28 100644 --- a/Alc/backends/alsa.cpp +++ b/Alc/backends/alsa.cpp @@ -404,7 +404,6 @@ struct AlsaPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "AlsaPlayback::"; } DEF_NEWDEL(AlsaPlayback) }; @@ -878,7 +877,6 @@ struct AlsaCapture final : public BackendBase { snd_pcm_sframes_t mLastAvail{0}; - static constexpr inline const char *CurrentPrefix() noexcept { return "AlsaCapture::"; } DEF_NEWDEL(AlsaCapture) }; diff --git a/Alc/backends/coreaudio.cpp b/Alc/backends/coreaudio.cpp index d8b4500e..a776cb9e 100644 --- a/Alc/backends/coreaudio.cpp +++ b/Alc/backends/coreaudio.cpp @@ -63,7 +63,6 @@ struct CoreAudioPlayback final : public BackendBase { ALuint mFrameSize{0u}; AudioStreamBasicDescription mFormat{}; // This is the OpenAL format as a CoreAudio ASBD - static constexpr inline const char *CurrentPrefix() noexcept { return "CoreAudioPlayback::"; } DEF_NEWDEL(CoreAudioPlayback) }; @@ -329,7 +328,6 @@ struct CoreAudioCapture final : public BackendBase { RingBufferPtr mRing{nullptr}; - static constexpr inline const char *CurrentPrefix() noexcept { return "CoreAudioCapture::"; } DEF_NEWDEL(CoreAudioCapture) }; diff --git a/Alc/backends/dsound.cpp b/Alc/backends/dsound.cpp index 38b1b9f8..039f78ac 100644 --- a/Alc/backends/dsound.cpp +++ b/Alc/backends/dsound.cpp @@ -173,7 +173,6 @@ struct DSoundPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "DSoundPlayback::"; } DEF_NEWDEL(DSoundPlayback) }; @@ -601,7 +600,6 @@ struct DSoundCapture final : public BackendBase { RingBufferPtr mRing; - static constexpr inline const char *CurrentPrefix() noexcept { return "DSoundCapture::"; } DEF_NEWDEL(DSoundCapture) }; diff --git a/Alc/backends/jack.cpp b/Alc/backends/jack.cpp index 74364f6a..c58f73bc 100644 --- a/Alc/backends/jack.cpp +++ b/Alc/backends/jack.cpp @@ -176,7 +176,6 @@ struct JackPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "JackPlayback::"; } DEF_NEWDEL(JackPlayback) }; diff --git a/Alc/backends/null.cpp b/Alc/backends/null.cpp index 07907dec..121d7700 100644 --- a/Alc/backends/null.cpp +++ b/Alc/backends/null.cpp @@ -58,7 +58,6 @@ struct NullBackend final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "NullBackend::"; } DEF_NEWDEL(NullBackend) }; diff --git a/Alc/backends/opensl.cpp b/Alc/backends/opensl.cpp index 1cf309f7..4cf7ca36 100644 --- a/Alc/backends/opensl.cpp +++ b/Alc/backends/opensl.cpp @@ -174,7 +174,6 @@ struct OpenSLPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "OpenSLPlayback::"; } DEF_NEWDEL(OpenSLPlayback) }; @@ -632,7 +631,6 @@ struct OpenSLCapture final : public BackendBase { ALsizei mFrameSize{0}; - static constexpr inline const char *CurrentPrefix() noexcept { return "OpenSLCapture::"; } DEF_NEWDEL(OpenSLCapture) }; diff --git a/Alc/backends/oss.cpp b/Alc/backends/oss.cpp index cc385edf..0a28fcd8 100644 --- a/Alc/backends/oss.cpp +++ b/Alc/backends/oss.cpp @@ -260,7 +260,6 @@ struct OSSPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "OSSPlayback::"; } DEF_NEWDEL(OSSPlayback) }; @@ -490,7 +489,6 @@ struct OSScapture final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "OSScapture::"; } DEF_NEWDEL(OSScapture) }; diff --git a/Alc/backends/portaudio.cpp b/Alc/backends/portaudio.cpp index 6df98434..990fcbf6 100644 --- a/Alc/backends/portaudio.cpp +++ b/Alc/backends/portaudio.cpp @@ -89,7 +89,6 @@ struct PortPlayback final : public BackendBase { PaStreamParameters mParams{}; ALuint mUpdateSize{0u}; - static constexpr inline const char *CurrentPrefix() noexcept { return "PortPlayback::"; } DEF_NEWDEL(PortPlayback) }; @@ -256,7 +255,6 @@ struct PortCapture final : public BackendBase { RingBufferPtr mRing{nullptr}; - static constexpr inline const char *CurrentPrefix() noexcept { return "PortCapture::"; } DEF_NEWDEL(PortCapture) }; diff --git a/Alc/backends/pulseaudio.cpp b/Alc/backends/pulseaudio.cpp index f5483818..30c0053d 100644 --- a/Alc/backends/pulseaudio.cpp +++ b/Alc/backends/pulseaudio.cpp @@ -681,7 +681,6 @@ struct PulsePlayback final : public BackendBase { ALuint mFrameSize{0u}; - static constexpr inline const char *CurrentPrefix() noexcept { return "PulsePlayback::"; } DEF_NEWDEL(PulsePlayback) }; @@ -1130,7 +1129,6 @@ struct PulseCapture final : public BackendBase { pa_stream *mStream{nullptr}; pa_context *mContext{nullptr}; - static constexpr inline const char *CurrentPrefix() noexcept { return "PulseCapture::"; } DEF_NEWDEL(PulseCapture) }; diff --git a/Alc/backends/qsa.cpp b/Alc/backends/qsa.cpp index 534d5798..074430ca 100644 --- a/Alc/backends/qsa.cpp +++ b/Alc/backends/qsa.cpp @@ -181,7 +181,6 @@ struct PlaybackWrapper final : public BackendBase { std::unique_ptr<qsa_data> mExtraData; - static constexpr inline const char *CurrentPrefix() noexcept { return "PlaybackWrapper::"; } DEF_NEWDEL(PlaybackWrapper) }; @@ -643,7 +642,6 @@ struct CaptureWrapper final : public BackendBase { std::unique_ptr<qsa_data> mExtraData; - static constexpr inline const char *CurrentPrefix() noexcept { return "CaptureWrapper::"; } DEF_NEWDEL(CaptureWrapper) }; diff --git a/Alc/backends/sdl2.cpp b/Alc/backends/sdl2.cpp index 51c927cc..a7a1752e 100644 --- a/Alc/backends/sdl2.cpp +++ b/Alc/backends/sdl2.cpp @@ -65,7 +65,6 @@ struct Sdl2Backend final : public BackendBase { DevFmtType mFmtType{}; ALuint mUpdateSize{0u}; - static constexpr inline const char *CurrentPrefix() noexcept { return "ALCsdl2Playback::"; } DEF_NEWDEL(Sdl2Backend) }; diff --git a/Alc/backends/sndio.cpp b/Alc/backends/sndio.cpp index 163dd2ff..e696cf55 100644 --- a/Alc/backends/sndio.cpp +++ b/Alc/backends/sndio.cpp @@ -61,7 +61,6 @@ struct SndioPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "SndioPlayback::"; } DEF_NEWDEL(SndioPlayback) }; @@ -263,7 +262,6 @@ struct SndioCapture final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "SndioCapture::"; } DEF_NEWDEL(SndioCapture) }; diff --git a/Alc/backends/solaris.cpp b/Alc/backends/solaris.cpp index 3e59a78c..5c378bff 100644 --- a/Alc/backends/solaris.cpp +++ b/Alc/backends/solaris.cpp @@ -73,7 +73,6 @@ struct SolarisBackend final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "SolarisBackend::"; } DEF_NEWDEL(SolarisBackend) }; diff --git a/Alc/backends/wasapi.cpp b/Alc/backends/wasapi.cpp index e41116d4..c80e5943 100644 --- a/Alc/backends/wasapi.cpp +++ b/Alc/backends/wasapi.cpp @@ -376,8 +376,6 @@ struct WasapiProxy { } static int messageHandler(std::promise<HRESULT> *promise); - - static constexpr inline const char *CurrentPrefix() noexcept { return "WasapiProxy::"; } }; std::deque<WasapiProxy::Msg> WasapiProxy::mMsgQueue; std::mutex WasapiProxy::mMsgQueueLock; @@ -533,7 +531,6 @@ struct WasapiPlayback final : public BackendBase, WasapiProxy { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "WasapiPlayback::"; } DEF_NEWDEL(WasapiPlayback) }; @@ -1113,7 +1110,6 @@ struct WasapiCapture final : public BackendBase, WasapiProxy { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "WasapiCapture::"; } DEF_NEWDEL(WasapiCapture) }; diff --git a/Alc/backends/wave.cpp b/Alc/backends/wave.cpp index bf1736f2..d06f36d7 100644 --- a/Alc/backends/wave.cpp +++ b/Alc/backends/wave.cpp @@ -98,7 +98,6 @@ struct WaveBackend final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "WaveBackend::"; } DEF_NEWDEL(WaveBackend) }; diff --git a/Alc/backends/winmm.cpp b/Alc/backends/winmm.cpp index 12fa02c4..f23ac53c 100644 --- a/Alc/backends/winmm.cpp +++ b/Alc/backends/winmm.cpp @@ -147,7 +147,6 @@ struct WinMMPlayback final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "WinMMPlayback::"; } DEF_NEWDEL(WinMMPlayback) }; @@ -393,7 +392,6 @@ struct WinMMCapture final : public BackendBase { std::atomic<bool> mKillNow{true}; std::thread mThread; - static constexpr inline const char *CurrentPrefix() noexcept { return "WinMMCapture::"; } DEF_NEWDEL(WinMMCapture) }; diff --git a/Alc/helpers.cpp b/Alc/helpers.cpp index 1a62263e..813b954f 100644 --- a/Alc/helpers.cpp +++ b/Alc/helpers.cpp @@ -336,7 +336,7 @@ const PathNamePair &GetProcBinary() else ret.fname = wstr_to_utf8(fullpath.data()); - TRACE("Got: %s, %s\n", ret.path.c_str(), ret.fname.c_str()); + TRACE("Got binary: %s, %s\n", ret.path.c_str(), ret.fname.c_str()); return ret; } @@ -356,7 +356,7 @@ void *GetSymbol(void *handle, const char *name) } -void al_print(const char *type, const char *prefix, const char *func, const char *fmt, ...) +void al_print(const char *type, const char *fmt, ...) { al::vector<char> dynmsg; char stcmsg[256]; @@ -376,7 +376,7 @@ void al_print(const char *type, const char *prefix, const char *func, const char va_end(args); std::wstring wstr{utf8_to_wstr(str)}; - fprintf(gLogFile, "AL lib: %s %s%s: %ls", type, prefix, func, wstr.c_str()); + fprintf(gLogFile, "AL lib: %s %ls", type, wstr.c_str()); fflush(gLogFile); } @@ -560,7 +560,7 @@ const PathNamePair &GetProcBinary() else ret.fname = std::string(pathname.cbegin(), pathname.cend()); - TRACE("Got: %s, %s\n", ret.path.c_str(), ret.fname.c_str()); + TRACE("Got binary: %s, %s\n", ret.path.c_str(), ret.fname.c_str()); return ret; } @@ -592,12 +592,12 @@ void *GetSymbol(void *handle, const char *name) #endif /* HAVE_DLFCN_H */ -void al_print(const char *type, const char *prefix, const char *func, const char *fmt, ...) +void al_print(const char *type, const char *fmt, ...) { va_list ap; va_start(ap, fmt); - fprintf(gLogFile, "AL lib: %s %s%s: ", type, prefix, func); + fprintf(gLogFile, "AL lib: %s ", type); vfprintf(gLogFile, fmt, ap); va_end(ap); diff --git a/Alc/hrtf.cpp b/Alc/hrtf.cpp index d1029aeb..16b2dc3c 100644 --- a/Alc/hrtf.cpp +++ b/Alc/hrtf.cpp @@ -1365,13 +1365,13 @@ HrtfEntry *GetLoadedHrtf(HrtfHandle *handle) void HrtfEntry::IncRef() { auto ref = IncrementRef(&this->ref); - TRACEREF("%p increasing refcount to %u\n", this, ref); + TRACEREF("HrtfEntry %p increasing refcount to %u\n", this, ref); } void HrtfEntry::DecRef() { auto ref = DecrementRef(&this->ref); - TRACEREF("%p decreasing refcount to %u\n", this, ref); + TRACEREF("HrtfEntry %p decreasing refcount to %u\n", this, ref); if(ref == 0) { std::lock_guard<std::mutex> _{LoadedHrtfLock}; @@ -50,7 +50,6 @@ struct HrtfEntry { void IncRef(); void DecRef(); - static constexpr inline const char *CurrentPrefix() noexcept { return "HrtfEntry::"; } DEF_PLACE_NEWDEL() }; diff --git a/Alc/logging.h b/Alc/logging.h index e709bbf2..b5faf698 100644 --- a/Alc/logging.h +++ b/Alc/logging.h @@ -15,19 +15,18 @@ extern FILE *gLogFile; -constexpr inline const char *CurrentPrefix() noexcept { return ""; } -#if defined(__GNUC__) && !defined(_WIN32) -#define AL_PRINT(T, MSG, ...) fprintf(gLogFile, "AL lib: %s %s%s: " MSG, T, CurrentPrefix(), __FUNCTION__ , ## __VA_ARGS__) +#if !defined(_WIN32) +#define AL_PRINT(T, ...) fprintf(gLogFile, "AL lib: " T " " __VA_ARGS__) #else -void al_print(const char *type, const char *prefix, const char *func, const char *fmt, ...) DECL_FORMAT(printf, 4,5); -#define AL_PRINT(T, ...) al_print((T), CurrentPrefix(), __FUNCTION__, __VA_ARGS__) +void al_print(const char *type, const char *fmt, ...) DECL_FORMAT(printf, 2,3); +#define AL_PRINT(T, ...) al_print((T), __VA_ARGS__) #endif #ifdef __ANDROID__ #include <android/log.h> -#define LOG_ANDROID(T, MSG, ...) __android_log_print(T, "openal", "AL lib: %s%s: " MSG, CurrentPrefix(), __FUNCTION__ , ## __VA_ARGS__) +#define LOG_ANDROID(T, ...) __android_log_print(T, "openal", "AL lib: " __VA_ARGS__) #else -#define LOG_ANDROID(T, MSG, ...) ((void)0) +#define LOG_ANDROID(T, ...) ((void)0) #endif enum LogLevel { diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h index 7538ade2..36042782 100644 --- a/OpenAL32/Include/alMain.h +++ b/OpenAL32/Include/alMain.h @@ -471,7 +471,6 @@ struct ALCdevice { ALsizei channelsFromFmt() const noexcept { return ChannelsFromDevFmt(FmtChans, mAmbiOrder); } ALsizei frameSizeFromFmt() const noexcept { return bytesFromFmt() * channelsFromFmt(); } - static constexpr inline const char *CurrentPrefix() noexcept { return "ALCdevice::"; } DEF_NEWDEL(ALCdevice) }; diff --git a/OpenAL32/alAuxEffectSlot.cpp b/OpenAL32/alAuxEffectSlot.cpp index ae038581..eeb545c9 100644 --- a/OpenAL32/alAuxEffectSlot.cpp +++ b/OpenAL32/alAuxEffectSlot.cpp @@ -688,13 +688,13 @@ ALenum InitializeEffect(ALCcontext *Context, ALeffectslot *EffectSlot, ALeffect void EffectState::IncRef() noexcept { auto ref = IncrementRef(&mRef); - TRACEREF("%p increasing refcount to %u\n", this, ref); + TRACEREF("EffectState %p increasing refcount to %u\n", this, ref); } void EffectState::DecRef() noexcept { auto ref = DecrementRef(&mRef); - TRACEREF("%p decreasing refcount to %u\n", this, ref); + TRACEREF("EffectState %p decreasing refcount to %u\n", this, ref); if(ref == 0) delete this; } |