Add AggregateLogger, a Logger specialization for singleton classes.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 20:18:08 +0000 (20:18 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Mar 2019 20:18:08 +0000 (20:18 +0000)
commit1cd14d973a2f744957cd4d7896ac13664a166e82
tree7f9c5ec6cd24cb059c95e138865528c3ffcc0f46
parent0fd59fba7b4a63f49afd4380cb61eb7123f29de0
Add AggregateLogger, a Logger specialization for singleton classes.
https://bugs.webkit.org/show_bug.cgi?id=195644

Reviewed by Eric Carlson.

Source/WebCore:

Convert debug logging over to release logging through the use of AggregateLogger.

* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSession::client const):
* platform/audio/PlatformMediaSessionManager.cpp:
(WebCore::PlatformMediaSessionManager::PlatformMediaSessionManager):
(WebCore::PlatformMediaSessionManager::beginInterruption):
(WebCore::PlatformMediaSessionManager::endInterruption):
(WebCore::PlatformMediaSessionManager::addSession):
(WebCore::PlatformMediaSessionManager::removeSession):
(WebCore::PlatformMediaSessionManager::sessionWillBeginPlayback):
(WebCore::PlatformMediaSessionManager::sessionWillEndPlayback):
(WebCore::PlatformMediaSessionManager::setCurrentSession):
(WebCore::PlatformMediaSessionManager::applicationWillBecomeInactive const):
(WebCore::PlatformMediaSessionManager::applicationDidBecomeActive const):
(WebCore::PlatformMediaSessionManager::applicationDidEnterBackground const):
(WebCore::PlatformMediaSessionManager::applicationWillEnterForeground const):
(WebCore::PlatformMediaSessionManager::logChannel const):
* platform/audio/PlatformMediaSessionManager.h:
* platform/audio/cocoa/MediaSessionManagerCocoa.mm:
(MediaSessionManagerCocoa::updateSessionState):
(MediaSessionManagerCocoa::sessionWillBeginPlayback):
(MediaSessionManagerCocoa::removeSession):
(MediaSessionManagerCocoa::sessionWillEndPlayback):
(MediaSessionManagerCocoa::clientCharacteristicsChanged):
(MediaSessionManagerCocoa::updateNowPlayingInfo):
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::resetRestrictions):
(WebCore::MediaSessionManageriOS::configureWireLessTargetMonitoring):

Source/WTF:

Add a new class, AggregateLogger, which will log messages to each of its aggregated loggers.

Drive-by fixes: allow "const void*" to be directly logged by converting the pointer to a hex string.

* WTF.xcodeproj/project.pbxproj:
* wtf/AggregateLogger.h: Added.
(WTF::AggregateLogger::create):
(WTF::AggregateLogger::addLogger):
(WTF::AggregateLogger::removeLogger):
(WTF::AggregateLogger::logAlways const):
(WTF::AggregateLogger::error const):
(WTF::AggregateLogger::warning const):
(WTF::AggregateLogger::info const):
(WTF::AggregateLogger::debug const):
(WTF::AggregateLogger::willLog const):
(WTF::AggregateLogger::AggregateLogger):
(WTF::AggregateLogger::log const):
* wtf/CMakeLists.h:
* wtf/Logger.cpp:
(WTF::>::toString):
* wtf/Logger.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242901 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WTF/ChangeLog
Source/WTF/WTF.xcodeproj/project.pbxproj
Source/WTF/wtf/AggregateLogger.h [new file with mode: 0644]
Source/WTF/wtf/CMakeLists.txt
Source/WTF/wtf/Logger.cpp
Source/WTF/wtf/Logger.h
Source/WebCore/ChangeLog
Source/WebCore/platform/audio/PlatformMediaSession.h
Source/WebCore/platform/audio/PlatformMediaSessionManager.cpp
Source/WebCore/platform/audio/PlatformMediaSessionManager.h
Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.h
Source/WebCore/platform/audio/cocoa/MediaSessionManagerCocoa.mm
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm