diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 16c35b4ae..9a020015f 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -26,6 +26,10 @@ AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchToRandom="Switch to an AdvSceneSwitcher.generalTab.generalBehavior.onNoMet.switchTo="Switch to:" AdvSceneSwitcher.generalTab.generalBehavior.cooldown="After performing actions skip performing actions for" AdvSceneSwitcher.generalTab.generalBehavior.cooldownHint="During this time potential matches will be ignored!" +AdvSceneSwitcher.generalTab.generalBehavior.logLevel="Log level:" +AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default="Default" +AdvSceneSwitcher.generalTab.generalBehavior.logLevel.printActions="Log performed actions" +AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose="Verbose logging" AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging="Enable verbose logging" AdvSceneSwitcher.generalTab.generalBehavior.saveWindowGeo="Save window position and size" AdvSceneSwitcher.generalTab.generalBehavior.showTrayNotifications="Show system tray notifications" diff --git a/forms/advanced-scene-switcher.ui b/forms/advanced-scene-switcher.ui index c9e788a22..7494a9b68 100644 --- a/forms/advanced-scene-switcher.ui +++ b/forms/advanced-scene-switcher.ui @@ -163,12 +163,31 @@ - + - AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging + AdvSceneSwitcher.generalTab.generalBehavior.logLevel + + + + + AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default + + + + + AdvSceneSwitcher.generalTab.generalBehavior.logLevel.printActions + + + + + AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose + + + + @@ -5078,7 +5097,7 @@ checkInterval startupBehavior autoStartEvent - verboseLogging + logLevel saveWindowGeo showTrayNotifications uiHintsDisable diff --git a/lib/advanced-scene-switcher.hpp b/lib/advanced-scene-switcher.hpp index 90556315f..f075d2d2c 100644 --- a/lib/advanced-scene-switcher.hpp +++ b/lib/advanced-scene-switcher.hpp @@ -55,6 +55,7 @@ public slots: void NoMatchDelayDurationChanged(const Duration &); void CooldownDurationChanged(const Duration &); void on_startupBehavior_currentIndexChanged(int index); + void on_logLevel_currentIndexChanged(int index); void on_autoStartEvent_currentIndexChanged(int index); void on_noMatchSwitchScene_currentTextChanged(const QString &text); void on_checkInterval_valueChanged(int value); @@ -62,7 +63,6 @@ public slots: void on_tabWidget_currentChanged(int index); void on_exportSettings_clicked(); void on_importSettings_clicked(); - void on_verboseLogging_stateChanged(int state); void on_saveWindowGeo_stateChanged(int state); void on_showTrayNotifications_stateChanged(int state); void on_uiHintsDisable_stateChanged(int state); diff --git a/lib/general.cpp b/lib/general.cpp index f8d33af0a..499905b8c 100644 --- a/lib/general.cpp +++ b/lib/general.cpp @@ -112,6 +112,14 @@ void AdvSceneSwitcher::on_startupBehavior_currentIndexChanged(int index) static_cast(index); } +void AdvSceneSwitcher::on_logLevel_currentIndexChanged(int value) +{ + if (loading) { + return; + } + switcher->logLevel = static_cast(value); +} + void AdvSceneSwitcher::on_autoStartEvent_currentIndexChanged(int index) { if (loading) { @@ -157,15 +165,6 @@ void AdvSceneSwitcher::closeEvent(QCloseEvent *) obs_frontend_save(); } -void AdvSceneSwitcher::on_verboseLogging_stateChanged(int state) -{ - if (loading) { - return; - } - - switcher->verbose = state; -} - void AdvSceneSwitcher::on_saveWindowGeo_stateChanged(int state) { if (loading) { @@ -598,7 +597,7 @@ void SwitcherData::SaveGeneralSettings(obs_data_t *obj) obs_data_set_int(obj, "autoStartEvent", static_cast(autoStartEvent)); - obs_data_set_bool(obj, "verbose", verbose); + obs_data_set_int(obj, "logLevel", static_cast(logLevel)); obs_data_set_bool(obj, "showSystemTrayNotifications", showSystemTrayNotifications); obs_data_set_bool(obj, "disableHints", disableHints); @@ -649,7 +648,7 @@ void SwitcherData::LoadGeneralSettings(obs_data_t *obj) autoStartEvent = static_cast(obs_data_get_int(obj, "autoStartEvent")); - verbose = obs_data_get_bool(obj, "verbose"); + logLevel = static_cast(obs_data_get_int(obj, "logLevel")); showSystemTrayNotifications = obs_data_get_bool(obj, "showSystemTrayNotifications"); disableHints = obs_data_get_bool(obj, "disableHints"); @@ -940,7 +939,8 @@ void AdvSceneSwitcher::SetupGeneralTab() SIGNAL(DurationChanged(const Duration &)), this, SLOT(CooldownDurationChanged(const Duration &))); - ui->verboseLogging->setChecked(switcher->verbose); + ui->logLevel->setCurrentIndex(static_cast(switcher->logLevel)); + ui->saveWindowGeo->setChecked(switcher->saveWindowGeo); ui->showTrayNotifications->setChecked( switcher->showSystemTrayNotifications); diff --git a/lib/legacy/switch-audio.cpp b/lib/legacy/switch-audio.cpp index 88d1fdba6..e92c9d4a7 100644 --- a/lib/legacy/switch-audio.cpp +++ b/lib/legacy/switch-audio.cpp @@ -104,7 +104,7 @@ void SwitcherData::checkAudioSwitchFallback(OBSWeakSource &scene, scene = audioFallback.getScene(); transition = audioFallback.transition; - if (verbose) { + if (VerboseLoggingEnabled()) { audioFallback.logMatch(); } } @@ -165,7 +165,7 @@ bool SwitcherData::checkAudioSwitch(OBSWeakSource &scene, transition = s.transition; match = true; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } diff --git a/lib/legacy/switch-executable.cpp b/lib/legacy/switch-executable.cpp index 09185f16b..48d86197b 100644 --- a/lib/legacy/switch-executable.cpp +++ b/lib/legacy/switch-executable.cpp @@ -119,7 +119,7 @@ bool SwitcherData::checkExeSwitch(OBSWeakSource &scene, scene = s.getScene(); transition = s.transition; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } break; diff --git a/lib/legacy/switch-file.cpp b/lib/legacy/switch-file.cpp index b3b321802..7cede7309 100644 --- a/lib/legacy/switch-file.cpp +++ b/lib/legacy/switch-file.cpp @@ -274,7 +274,7 @@ bool SwitcherData::checkFileContent(OBSWeakSource &scene, transition = s.transition; match = true; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } break; diff --git a/lib/legacy/switch-idle.cpp b/lib/legacy/switch-idle.cpp index 8801d9206..40caa891e 100644 --- a/lib/legacy/switch-idle.cpp +++ b/lib/legacy/switch-idle.cpp @@ -53,7 +53,7 @@ bool SwitcherData::checkIdleSwitch(OBSWeakSource &scene, match = true; idleData.alreadySwitched = true; - if (verbose) { + if (VerboseLoggingEnabled()) { idleData.logMatch(); } } else { diff --git a/lib/legacy/switch-media.cpp b/lib/legacy/switch-media.cpp index 4b08e7edb..973ef77bb 100644 --- a/lib/legacy/switch-media.cpp +++ b/lib/legacy/switch-media.cpp @@ -193,7 +193,7 @@ bool SwitcherData::checkMediaSwitch(OBSWeakSource &scene, scene = mediaSwitch.getScene(); transition = mediaSwitch.transition; - if (verbose) { + if (VerboseLoggingEnabled()) { mediaSwitch.logMatch(); } } diff --git a/lib/legacy/switch-network.cpp b/lib/legacy/switch-network.cpp index 5633b9568..e5beb774f 100644 --- a/lib/legacy/switch-network.cpp +++ b/lib/legacy/switch-network.cpp @@ -253,7 +253,7 @@ void WSServer::sendMessage(SceneSwitchInfo sceneSwitch, bool preview) } } - if (switcher->verbose) { + if (VerboseLoggingEnabled()) { blog(LOG_INFO, "server sent message:\n%s", message.c_str()); } } @@ -305,7 +305,7 @@ std::string processMessage(std::string payload) std::string ret = "message ok"; auto transition = GetWeakTransitionByName(transitionName.c_str()); - if (switcher->verbose && !transition) { + if (VerboseLoggingEnabled() && !transition) { ret += " - ignoring invalid transition: '" + transitionName + "'"; } @@ -481,7 +481,7 @@ void WSClient::onMessage(connection_hdl hdl, client::message_ptr message) errorCodeMessage.c_str()); } - if (switcher->verbose) { + if (VerboseLoggingEnabled()) { blog(LOG_INFO, "client sent message:\n%s", response.c_str()); } } diff --git a/lib/legacy/switch-random.cpp b/lib/legacy/switch-random.cpp index 7b9160419..94bc13490 100644 --- a/lib/legacy/switch-random.cpp +++ b/lib/legacy/switch-random.cpp @@ -76,7 +76,7 @@ bool SwitcherData::checkRandom(OBSWeakSource &scene, OBSWeakSource &transition, lastRandomScene = r.scene; lastRandomSceneGroup = r.group; - if (verbose) { + if (VerboseLoggingEnabled()) { r.logMatch(); } break; diff --git a/lib/legacy/switch-screen-region.cpp b/lib/legacy/switch-screen-region.cpp index 9eba3c26d..5eee08240 100644 --- a/lib/legacy/switch-screen-region.cpp +++ b/lib/legacy/switch-screen-region.cpp @@ -183,7 +183,7 @@ bool SwitcherData::checkScreenRegionSwitch(OBSWeakSource &scene, transition = s.transition; minRegionSize = regionSize; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } break; diff --git a/lib/legacy/switch-sequence.cpp b/lib/legacy/switch-sequence.cpp index fad0ef819..5b407c215 100644 --- a/lib/legacy/switch-sequence.cpp +++ b/lib/legacy/switch-sequence.cpp @@ -225,13 +225,13 @@ bool SwitcherData::checkSceneSequence(OBSWeakSource &scene, scene = s.getScene(); transition = s.transition; setPrevSceneAfterLinger = s.usePreviousScene; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } } s.advanceActiveSequence(); - if (verbose) { + if (VerboseLoggingEnabled()) { s.logAdvanceSequence(); } diff --git a/lib/legacy/switch-time.cpp b/lib/legacy/switch-time.cpp index b89054f79..f6964a143 100644 --- a/lib/legacy/switch-time.cpp +++ b/lib/legacy/switch-time.cpp @@ -142,7 +142,7 @@ bool SwitcherData::checkTimeSwitch(OBSWeakSource &scene, transition = s.transition; match = true; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } break; diff --git a/lib/legacy/switch-transitions.cpp b/lib/legacy/switch-transitions.cpp index 320d8f4b4..bdf5d5833 100644 --- a/lib/legacy/switch-transitions.cpp +++ b/lib/legacy/switch-transitions.cpp @@ -168,7 +168,7 @@ void SwitcherData::checkDefaultSceneTransitions() for (auto &t : defaultSceneTransitions) { if (t.checkMatch(currentScene)) { - if (verbose) { + if (VerboseLoggingEnabled()) { t.logMatch(); } t.setTransition(); @@ -427,7 +427,8 @@ DefTransitionSwitchWidget::DefTransitionSwitchWidget(QWidget *parent, { QHBoxLayout *mainLayout = new QHBoxLayout; std::unordered_map widgetPlaceholders = { - {"{{scenes}}", scenes}, {"{{transitions}}", transitions}}; + {"{{scenes}}", scenes}, + {"{{transitions}}", transitions}}; PlaceWidgets( obs_module_text( "AdvSceneSwitcher.transitionTab.defaultTransitionEntry"), diff --git a/lib/legacy/switch-video.cpp b/lib/legacy/switch-video.cpp index 237c34bd8..451f9c807 100644 --- a/lib/legacy/switch-video.cpp +++ b/lib/legacy/switch-video.cpp @@ -148,7 +148,7 @@ bool SwitcherData::checkVideoSwitch(OBSWeakSource &scene, match = true; scene = s.getScene(); transition = s.transition; - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } } diff --git a/lib/legacy/switch-window.cpp b/lib/legacy/switch-window.cpp index 57a2b70f5..190b27546 100644 --- a/lib/legacy/switch-window.cpp +++ b/lib/legacy/switch-window.cpp @@ -249,7 +249,7 @@ bool SwitcherData::checkWindowTitleSwitch(OBSWeakSource &scene, } if (match) { - if (verbose) { + if (VerboseLoggingEnabled()) { s.logMatch(); } break; diff --git a/lib/macro/macro-action-macro.cpp b/lib/macro/macro-action-macro.cpp index 581ad0bff..49928ba66 100644 --- a/lib/macro/macro-action-macro.cpp +++ b/lib/macro/macro-action-macro.cpp @@ -88,32 +88,32 @@ void MacroActionMacro::LogAction() const } switch (_action) { case Action::PAUSE: - vblog(LOG_INFO, "paused \"%s\"", macro->Name().c_str()); + ablog(LOG_INFO, "paused \"%s\"", macro->Name().c_str()); break; case Action::UNPAUSE: - vblog(LOG_INFO, "unpaused \"%s\"", macro->Name().c_str()); + ablog(LOG_INFO, "unpaused \"%s\"", macro->Name().c_str()); break; case Action::RESET_COUNTER: - vblog(LOG_INFO, "reset counter for \"%s\"", + ablog(LOG_INFO, "reset counter for \"%s\"", macro->Name().c_str()); break; case Action::RUN: - vblog(LOG_INFO, "run nested macro \"%s\"", + ablog(LOG_INFO, "run nested macro \"%s\"", macro->Name().c_str()); break; case Action::STOP: - vblog(LOG_INFO, "stopped macro \"%s\"", macro->Name().c_str()); + ablog(LOG_INFO, "stopped macro \"%s\"", macro->Name().c_str()); break; case Action::DISABLE_ACTION: - vblog(LOG_INFO, "disabled action %d of macro \"%s\"", + ablog(LOG_INFO, "disabled action %d of macro \"%s\"", _actionIndex.GetValue(), macro->Name().c_str()); break; case Action::ENABLE_ACTION: - vblog(LOG_INFO, "enabled action %d of macro \"%s\"", + ablog(LOG_INFO, "enabled action %d of macro \"%s\"", _actionIndex.GetValue(), macro->Name().c_str()); break; case Action::TOGGLE_ACTION: - vblog(LOG_INFO, "toggled action %d of macro \"%s\"", + ablog(LOG_INFO, "toggled action %d of macro \"%s\"", _actionIndex.GetValue(), macro->Name().c_str()); break; default: diff --git a/lib/macro/macro-action-queue.cpp b/lib/macro/macro-action-queue.cpp index cf66740e7..a85e9185a 100644 --- a/lib/macro/macro-action-queue.cpp +++ b/lib/macro/macro-action-queue.cpp @@ -69,20 +69,20 @@ void MacroActionQueue::LogAction() const } switch (_action) { case Action::ADD_TO_QUEUE: - vblog(LOG_INFO, "queued actions of \"%s\" to \"%s\"", + ablog(LOG_INFO, "queued actions of \"%s\" to \"%s\"", GetMacroName(macro.get()).c_str(), GetActionQueueName(_queue).c_str()); break; case Action::START_QUEUE: - vblog(LOG_INFO, "start queue \"%s\"", + ablog(LOG_INFO, "start queue \"%s\"", GetActionQueueName(_queue).c_str()); break; case Action::STOP_QUEUE: - vblog(LOG_INFO, "stop queue \"%s\"", + ablog(LOG_INFO, "stop queue \"%s\"", GetActionQueueName(_queue).c_str()); break; case Action::CLEAR_QUEUE: - vblog(LOG_INFO, "cleared queue \"%s\"", + ablog(LOG_INFO, "cleared queue \"%s\"", GetActionQueueName(_queue).c_str()); break; default: diff --git a/lib/macro/macro-action.cpp b/lib/macro/macro-action.cpp index d9c4c32a9..ce40ffff7 100644 --- a/lib/macro/macro-action.cpp +++ b/lib/macro/macro-action.cpp @@ -25,7 +25,7 @@ bool MacroAction::Load(obs_data_t *obj) void MacroAction::LogAction() const { - vblog(LOG_INFO, "performed action %s", GetId().c_str()); + ablog(LOG_INFO, "performed action %s", GetId().c_str()); } void MacroAction::SetEnabled(bool value) diff --git a/lib/switcher-data.hpp b/lib/switcher-data.hpp index a83c2bf42..0d2e98a7a 100644 --- a/lib/switcher-data.hpp +++ b/lib/switcher-data.hpp @@ -141,7 +141,9 @@ class SwitcherData { bool showSystemTrayNotifications = false; bool transitionOverrideOverride = false; bool adjustActiveTransitionType = true; - bool verbose = false; + + enum class LogLevel { DEFAULT, PRINT_ACTION, VERBOSE }; + LogLevel logLevel = LogLevel::DEFAULT; /* --- End of General tab section --- */ diff --git a/lib/utils/action-queue.cpp b/lib/utils/action-queue.cpp index 6360d4cc4..82617e3f4 100644 --- a/lib/utils/action-queue.cpp +++ b/lib/utils/action-queue.cpp @@ -134,8 +134,11 @@ void ActionQueue::RunActions() continue; } - vblog(LOG_INFO, "Performing action '%s' in queue '%s'", - action->GetId().c_str(), _name.c_str()); + if (ActionLoggingEnabled()) { + blog(LOG_INFO, "Performing action '%s' in queue '%s'", + action->GetId().c_str(), _name.c_str()); + action->LogAction(); + } action->PerformAction(); } } diff --git a/lib/utils/log-helper.cpp b/lib/utils/log-helper.cpp index 0acf7e907..7d38edbc1 100644 --- a/lib/utils/log-helper.cpp +++ b/lib/utils/log-helper.cpp @@ -5,7 +5,15 @@ namespace advss { bool VerboseLoggingEnabled() { - return GetSwitcher() && GetSwitcher()->verbose; + return GetSwitcher() && + GetSwitcher()->logLevel == SwitcherData::LogLevel::VERBOSE; +} + +bool ActionLoggingEnabled() +{ + return GetSwitcher() && GetSwitcher()->logLevel == + SwitcherData::LogLevel::PRINT_ACTION || + GetSwitcher()->logLevel == SwitcherData::LogLevel::VERBOSE; } } // namespace advss diff --git a/lib/utils/log-helper.hpp b/lib/utils/log-helper.hpp index 473b79210..b682c2bd0 100644 --- a/lib/utils/log-helper.hpp +++ b/lib/utils/log-helper.hpp @@ -10,7 +10,14 @@ namespace advss { blog(level, msg, ##__VA_ARGS__); \ } \ } while (0) +#define ablog(level, msg, ...) \ + do { \ + if (ActionLoggingEnabled()) { \ + blog(level, msg, ##__VA_ARGS__); \ + } \ + } while (0) EXPORT bool VerboseLoggingEnabled(); +EXPORT bool ActionLoggingEnabled(); } // namespace advss diff --git a/plugins/base/macro-action-audio.cpp b/plugins/base/macro-action-audio.cpp index eb1492ef0..274937ccc 100644 --- a/plugins/base/macro-action-audio.cpp +++ b/plugins/base/macro-action-audio.cpp @@ -244,7 +244,7 @@ void MacroActionAudio::LogAction() const auto it = actionTypes.find(_action); if (it != actionTypes.end()) { auto &[_, action] = *it; - vblog(LOG_INFO, + ablog(LOG_INFO, "performed action \"%s\" for source \"%s\" with volume %f with fade %d %f", action.c_str(), _audioSource.ToString(true).c_str(), GetVolume(), _fade, _duration.Seconds()); diff --git a/plugins/base/macro-action-file.cpp b/plugins/base/macro-action-file.cpp index 6fcdf29dd..9258d7e2b 100644 --- a/plugins/base/macro-action-file.cpp +++ b/plugins/base/macro-action-file.cpp @@ -45,7 +45,7 @@ void MacroActionFile::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\" for file \"%s\"", + ablog(LOG_INFO, "performed action \"%s\" for file \"%s\"", it->second.c_str(), _file.c_str()); } else { blog(LOG_WARNING, "ignored unknown file action %d", diff --git a/plugins/base/macro-action-filter.cpp b/plugins/base/macro-action-filter.cpp index d1d469da3..2398086f7 100644 --- a/plugins/base/macro-action-filter.cpp +++ b/plugins/base/macro-action-filter.cpp @@ -94,7 +94,7 @@ void MacroActionFilter::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, + ablog(LOG_INFO, "performed action \"%s\" for filter \"%s\" on source \"%s\"", it->second.c_str(), _filter.ToString().c_str(), _source.ToString(true).c_str()); diff --git a/plugins/base/macro-action-hotkey.cpp b/plugins/base/macro-action-hotkey.cpp index 0bb996dba..0baebc7dc 100644 --- a/plugins/base/macro-action-hotkey.cpp +++ b/plugins/base/macro-action-hotkey.cpp @@ -371,7 +371,7 @@ bool MacroActionHotkey::PerformAction() void MacroActionHotkey::LogAction() const { - vblog(LOG_INFO, "sent hotkey type %d", static_cast(_action)); + ablog(LOG_INFO, "sent hotkey type %d", static_cast(_action)); } bool MacroActionHotkey::Save(obs_data_t *obj) const diff --git a/plugins/base/macro-action-http.cpp b/plugins/base/macro-action-http.cpp index 722c1f694..8e63ab974 100644 --- a/plugins/base/macro-action-http.cpp +++ b/plugins/base/macro-action-http.cpp @@ -95,7 +95,7 @@ void MacroActionHttp::LogAction() const { auto it = methods.find(_method); if (it != methods.end()) { - vblog(LOG_INFO, + ablog(LOG_INFO, "sent http request \"%s\" to \"%s\" with data \"%s\"", it->second.c_str(), _url.c_str(), _data.c_str()); } else { diff --git a/plugins/base/macro-action-media.cpp b/plugins/base/macro-action-media.cpp index 6fdebd5fe..52dd91bcf 100644 --- a/plugins/base/macro-action-media.cpp +++ b/plugins/base/macro-action-media.cpp @@ -122,7 +122,7 @@ void MacroActionMedia::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\" for source \"%s\"", + ablog(LOG_INFO, "performed action \"%s\" for source \"%s\"", it->second.c_str(), _selection == SelectionType::SOURCE ? _mediaSource.ToString(true).c_str() diff --git a/plugins/base/macro-action-osc.cpp b/plugins/base/macro-action-osc.cpp index 571e8b110..43b8f90b2 100644 --- a/plugins/base/macro-action-osc.cpp +++ b/plugins/base/macro-action-osc.cpp @@ -147,7 +147,7 @@ bool MacroActionOSC::PerformAction() void MacroActionOSC::LogAction() const { - vblog(LOG_INFO, "sending OSC message '%s' to %s %s %d", + ablog(LOG_INFO, "sending OSC message '%s' to %s %s %d", _message.ToString().c_str(), _protocol == Protocol::UDP ? "UDP" : "TCP", _ip.c_str(), _port.GetValue()); diff --git a/plugins/base/macro-action-plugin-state.cpp b/plugins/base/macro-action-plugin-state.cpp index 4da83934f..fc6d01078 100644 --- a/plugins/base/macro-action-plugin-state.cpp +++ b/plugins/base/macro-action-plugin-state.cpp @@ -174,14 +174,14 @@ void MacroActionPluginState::LogAction() const blog(LOG_INFO, "stop() called by macro"); break; case PluginStateAction::NO_MATCH_BEHAVIOUR: - vblog(LOG_INFO, "setting no match to %d", _value); + ablog(LOG_INFO, "setting no match to %d", _value); break; case PluginStateAction::IMPORT_SETTINGS: - vblog(LOG_INFO, "importing settings from %s", + ablog(LOG_INFO, "importing settings from %s", _settingsPath.c_str()); break; case PluginStateAction::TERMINATE: - vblog(LOG_INFO, "sending terminate signal to OBS in 10s"); + ablog(LOG_INFO, "sending terminate signal to OBS in 10s"); break; default: blog(LOG_WARNING, "ignored unknown pluginState action %d", diff --git a/plugins/base/macro-action-profile.cpp b/plugins/base/macro-action-profile.cpp index 39358668a..1b4bc0e76 100644 --- a/plugins/base/macro-action-profile.cpp +++ b/plugins/base/macro-action-profile.cpp @@ -21,7 +21,7 @@ bool MacroActionProfile::PerformAction() void MacroActionProfile::LogAction() const { - vblog(LOG_INFO, "set profile type to \"%s\"", _profile.c_str()); + ablog(LOG_INFO, "set profile type to \"%s\"", _profile.c_str()); } bool MacroActionProfile::Save(obs_data_t *obj) const diff --git a/plugins/base/macro-action-projector.cpp b/plugins/base/macro-action-projector.cpp index 1435bbc12..64bf05717 100644 --- a/plugins/base/macro-action-projector.cpp +++ b/plugins/base/macro-action-projector.cpp @@ -75,7 +75,7 @@ void MacroActionProjector::LogAction() const { auto it = selectionTypes.find(_type); if (it != selectionTypes.end()) { - vblog(LOG_INFO, + ablog(LOG_INFO, "performed projector action \"%s\" with" "source \"%s\"," "scene \"%s\"," diff --git a/plugins/base/macro-action-random.cpp b/plugins/base/macro-action-random.cpp index 2ecba29e3..3408ed98e 100644 --- a/plugins/base/macro-action-random.cpp +++ b/plugins/base/macro-action-random.cpp @@ -64,7 +64,7 @@ bool MacroActionRandom::PerformAction() void MacroActionRandom::LogAction() const { - vblog(LOG_INFO, "running random macro"); + ablog(LOG_INFO, "running random macro"); } bool MacroActionRandom::Save(obs_data_t *obj) const diff --git a/plugins/base/macro-action-recording.cpp b/plugins/base/macro-action-recording.cpp index 7404f9a92..0feec5d3e 100644 --- a/plugins/base/macro-action-recording.cpp +++ b/plugins/base/macro-action-recording.cpp @@ -97,7 +97,7 @@ void MacroActionRecord::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); + ablog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); } else { blog(LOG_WARNING, "ignored unknown recording action %d", static_cast(_action)); diff --git a/plugins/base/macro-action-replay-buffer.cpp b/plugins/base/macro-action-replay-buffer.cpp index 7c8042f47..6e35b1423 100644 --- a/plugins/base/macro-action-replay-buffer.cpp +++ b/plugins/base/macro-action-replay-buffer.cpp @@ -47,7 +47,7 @@ void MacroActionReplayBuffer::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); + ablog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); } else { blog(LOG_WARNING, "ignored unknown replay buffer action %d", static_cast(_action)); diff --git a/plugins/base/macro-action-run.cpp b/plugins/base/macro-action-run.cpp index 04a170887..e5f73e938 100644 --- a/plugins/base/macro-action-run.cpp +++ b/plugins/base/macro-action-run.cpp @@ -33,7 +33,7 @@ bool MacroActionRun::PerformAction() void MacroActionRun::LogAction() const { - vblog(LOG_INFO, "run \"%s\"", _procConfig.UnresolvedPath().c_str()); + ablog(LOG_INFO, "run \"%s\"", _procConfig.UnresolvedPath().c_str()); } bool MacroActionRun::Save(obs_data_t *obj) const diff --git a/plugins/base/macro-action-scene-collection.cpp b/plugins/base/macro-action-scene-collection.cpp index 215d1b982..1530db186 100644 --- a/plugins/base/macro-action-scene-collection.cpp +++ b/plugins/base/macro-action-scene-collection.cpp @@ -31,7 +31,7 @@ bool MacroActionSceneCollection::PerformAction() void MacroActionSceneCollection::LogAction() const { - vblog(LOG_INFO, "set scene collection type to \"%s\"", + ablog(LOG_INFO, "set scene collection type to \"%s\"", _sceneCollection.c_str()); } diff --git a/plugins/base/macro-action-scene-lock.cpp b/plugins/base/macro-action-scene-lock.cpp index 18ae04e04..1d0028289 100644 --- a/plugins/base/macro-action-scene-lock.cpp +++ b/plugins/base/macro-action-scene-lock.cpp @@ -49,7 +49,7 @@ void MacroActionSceneLock::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, + ablog(LOG_INFO, "performed action \"%s\" for source \"%s\" on scene \"%s\"", it->second.c_str(), _source.ToString(true).c_str(), _scene.ToString(true).c_str()); diff --git a/plugins/base/macro-action-scene-order.cpp b/plugins/base/macro-action-scene-order.cpp index f9fe3b0ac..279173cb4 100644 --- a/plugins/base/macro-action-scene-order.cpp +++ b/plugins/base/macro-action-scene-order.cpp @@ -96,7 +96,7 @@ void MacroActionSceneOrder::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, + ablog(LOG_INFO, "performed order action \"%s\" for source \"%s\" on scene \"%s\"", it->second.c_str(), _source.ToString(true).c_str(), _scene.ToString(true).c_str()); diff --git a/plugins/base/macro-action-scene-switch.cpp b/plugins/base/macro-action-scene-switch.cpp index b04cdeaa6..bbddb0a17 100644 --- a/plugins/base/macro-action-scene-switch.cpp +++ b/plugins/base/macro-action-scene-switch.cpp @@ -164,7 +164,7 @@ bool MacroActionSwitchScene::PerformAction() void MacroActionSwitchScene::LogAction() const { - vblog(LOG_INFO, "switch%s scene to '%s'", + ablog(LOG_INFO, "switch%s scene to '%s'", _sceneType == SceneType::PREVIEW ? " preview" : "", _scene.ToString(true).c_str()); } diff --git a/plugins/base/macro-action-scene-transform.cpp b/plugins/base/macro-action-scene-transform.cpp index 4df554aa3..22d09c278 100644 --- a/plugins/base/macro-action-scene-transform.cpp +++ b/plugins/base/macro-action-scene-transform.cpp @@ -257,7 +257,7 @@ bool MacroActionSceneTransform::PerformAction() void MacroActionSceneTransform::LogAction() const { - vblog(LOG_INFO, + ablog(LOG_INFO, "performed transform action %d for source \"%s\" on scene \"%s\"", static_cast(_action), _source.ToString(true).c_str(), _scene.ToString(true).c_str()); diff --git a/plugins/base/macro-action-scene-visibility.cpp b/plugins/base/macro-action-scene-visibility.cpp index 93789657a..0a6b57bfd 100644 --- a/plugins/base/macro-action-scene-visibility.cpp +++ b/plugins/base/macro-action-scene-visibility.cpp @@ -50,7 +50,7 @@ void MacroActionSceneVisibility::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, + ablog(LOG_INFO, "performed visibility action \"%s\" for source \"%s\" on scene \"%s\"", it->second.c_str(), _source.ToString(true).c_str(), _scene.ToString(true).c_str()); diff --git a/plugins/base/macro-action-screenshot.cpp b/plugins/base/macro-action-screenshot.cpp index a5e0b0aa5..974bb7821 100644 --- a/plugins/base/macro-action-screenshot.cpp +++ b/plugins/base/macro-action-screenshot.cpp @@ -69,15 +69,15 @@ void MacroActionScreenshot::LogAction() const { switch (_targetType) { case MacroActionScreenshot::TargetType::SOURCE: - vblog(LOG_INFO, "trigger screenshot of \"%s\"", + ablog(LOG_INFO, "trigger screenshot of \"%s\"", _source.ToString(true).c_str()); break; case MacroActionScreenshot::TargetType::SCENE: - vblog(LOG_INFO, "trigger screenshot of \"%s\"", + ablog(LOG_INFO, "trigger screenshot of \"%s\"", _scene.ToString(true).c_str()); break; case MacroActionScreenshot::TargetType::MAIN_OUTPUT: - vblog(LOG_INFO, "trigger screenshot of main output"); + ablog(LOG_INFO, "trigger screenshot of main output"); break; } } diff --git a/plugins/base/macro-action-sequence.cpp b/plugins/base/macro-action-sequence.cpp index 94bbfc4c1..316156c42 100644 --- a/plugins/base/macro-action-sequence.cpp +++ b/plugins/base/macro-action-sequence.cpp @@ -137,7 +137,7 @@ bool MacroActionSequence::PerformAction() void MacroActionSequence::LogAction() const { if (_action == Action::RUN_SEQUENCE) { - vblog(LOG_INFO, "running macro sequence"); + ablog(LOG_INFO, "running macro sequence"); } else { vblog(LOG_INFO, "set sequences of macro '%s' to index %d", _macro.Name().c_str(), _resetIndex.GetValue()); diff --git a/plugins/base/macro-action-source.cpp b/plugins/base/macro-action-source.cpp index f2413d965..35d7d066a 100644 --- a/plugins/base/macro-action-source.cpp +++ b/plugins/base/macro-action-source.cpp @@ -209,7 +209,7 @@ void MacroActionSource::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\" for Source \"%s\"", + ablog(LOG_INFO, "performed action \"%s\" for Source \"%s\"", it->second.c_str(), _source.ToString(true).c_str()); } else { blog(LOG_WARNING, "ignored unknown source action %d", diff --git a/plugins/base/macro-action-streaming.cpp b/plugins/base/macro-action-streaming.cpp index ebec18bbf..6087c4e2e 100644 --- a/plugins/base/macro-action-streaming.cpp +++ b/plugins/base/macro-action-streaming.cpp @@ -128,7 +128,7 @@ void MacroActionStream::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); + ablog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); } else { blog(LOG_WARNING, "ignored unknown streaming action %d", static_cast(_action)); diff --git a/plugins/base/macro-action-studio-mode.cpp b/plugins/base/macro-action-studio-mode.cpp index 098cb0e35..2289b247a 100644 --- a/plugins/base/macro-action-studio-mode.cpp +++ b/plugins/base/macro-action-studio-mode.cpp @@ -69,7 +69,7 @@ void MacroActionSudioMode::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\" with scene \"%s\"", + ablog(LOG_INFO, "performed action \"%s\" with scene \"%s\"", it->second.c_str(), _scene.ToString(true).c_str()); } else { blog(LOG_WARNING, "ignored unknown studio mode action %d", diff --git a/plugins/base/macro-action-systray.cpp b/plugins/base/macro-action-systray.cpp index 8ccdad4e1..0e54cc3da 100644 --- a/plugins/base/macro-action-systray.cpp +++ b/plugins/base/macro-action-systray.cpp @@ -24,7 +24,7 @@ bool MacroActionSystray::PerformAction() void MacroActionSystray::LogAction() const { - vblog(LOG_INFO, "display systray message \"%s\":\n%s", _title.c_str(), + ablog(LOG_INFO, "display systray message \"%s\":\n%s", _title.c_str(), _message.c_str()); } diff --git a/plugins/base/macro-action-timer.cpp b/plugins/base/macro-action-timer.cpp index 95821e300..14b3da30e 100644 --- a/plugins/base/macro-action-timer.cpp +++ b/plugins/base/macro-action-timer.cpp @@ -71,19 +71,19 @@ void MacroActionTimer::LogAction() const } switch (_actionType) { case Action::PAUSE: - vblog(LOG_INFO, "paused timers on \"%s\"", + ablog(LOG_INFO, "paused timers on \"%s\"", GetMacroName(macro.get()).c_str()); break; case Action::CONTINUE: - vblog(LOG_INFO, "continued timers on \"%s\"", + ablog(LOG_INFO, "continued timers on \"%s\"", GetMacroName(macro.get()).c_str()); break; case Action::RESET: - vblog(LOG_INFO, "reset timers on \"%s\"", + ablog(LOG_INFO, "reset timers on \"%s\"", GetMacroName(macro.get()).c_str()); break; case Action::SET_TIME_REMAINING: - vblog(LOG_INFO, + ablog(LOG_INFO, "set time remaining of timers on \"%s\" to \"%s\"", GetMacroName(macro.get()).c_str(), _duration.ToString().c_str()); diff --git a/plugins/base/macro-action-transition.cpp b/plugins/base/macro-action-transition.cpp index cb17f1f64..8bdba9e64 100644 --- a/plugins/base/macro-action-transition.cpp +++ b/plugins/base/macro-action-transition.cpp @@ -156,11 +156,11 @@ void MacroActionTransition::LogAction() const break; } if (_setDuration) { - vblog(LOG_INFO, "%s duration to %s", msgBegin.c_str(), + ablog(LOG_INFO, "%s duration to %s", msgBegin.c_str(), _duration.ToString().c_str()); } if (_setTransitionType) { - vblog(LOG_INFO, "%s type to \"%s\"", msgBegin.c_str(), + ablog(LOG_INFO, "%s type to \"%s\"", msgBegin.c_str(), _transition.ToString().c_str()); } } diff --git a/plugins/base/macro-action-virtual-cam.cpp b/plugins/base/macro-action-virtual-cam.cpp index ae3a67eec..d93f00155 100644 --- a/plugins/base/macro-action-virtual-cam.cpp +++ b/plugins/base/macro-action-virtual-cam.cpp @@ -44,7 +44,7 @@ void MacroActionVCam::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); + ablog(LOG_INFO, "performed action \"%s\"", it->second.c_str()); } else { blog(LOG_WARNING, "ignored unknown virtual camera action %d", static_cast(_action)); diff --git a/plugins/base/macro-action-websocket.cpp b/plugins/base/macro-action-websocket.cpp index 3a26c2a0d..3f35691e9 100644 --- a/plugins/base/macro-action-websocket.cpp +++ b/plugins/base/macro-action-websocket.cpp @@ -56,7 +56,7 @@ bool MacroActionWebsocket::PerformAction() void MacroActionWebsocket::LogAction() const { if (_api == API::GENERIC_WEBSOCKET) { - vblog(LOG_INFO, + ablog(LOG_INFO, "sent generic websocket message \"%s\" via \"%s\"", _message.c_str(), GetWeakConnectionName(_connection).c_str()); @@ -64,7 +64,7 @@ void MacroActionWebsocket::LogAction() const } if (_api == API::OBS_WEBSOCKET) { - vblog(LOG_INFO, "sent obs websocket message \"%s\" via \"%s\"", + ablog(LOG_INFO, "sent obs websocket message \"%s\" via \"%s\"", _message.c_str(), GetWeakConnectionName(_connection).c_str()); return; @@ -72,12 +72,12 @@ void MacroActionWebsocket::LogAction() const switch (_type) { case MacroActionWebsocket::MessageType::REQUEST: - vblog(LOG_INFO, "sent scene switcher message \"%s\" via \"%s\"", + ablog(LOG_INFO, "sent scene switcher message \"%s\" via \"%s\"", _message.c_str(), GetWeakConnectionName(_connection).c_str()); break; case MacroActionWebsocket::MessageType::EVENT: - vblog(LOG_INFO, + ablog(LOG_INFO, "sent scene switcher event \"%s\" to connected clients", _message.c_str()); break; diff --git a/plugins/midi/macro-action-midi.cpp b/plugins/midi/macro-action-midi.cpp index 93708dca7..0d9aa29e7 100644 --- a/plugins/midi/macro-action-midi.cpp +++ b/plugins/midi/macro-action-midi.cpp @@ -23,7 +23,7 @@ bool MacroActionMidi::PerformAction() void MacroActionMidi::LogAction() const { - vblog(LOG_INFO, "send midi message \"%s\" to \"%s\"", + ablog(LOG_INFO, "send midi message \"%s\" to \"%s\"", _message.ToString().c_str(), _device.Name().c_str()); } diff --git a/plugins/twitch/macro-action-twitch.cpp b/plugins/twitch/macro-action-twitch.cpp index 8d59d017c..12db0b6bd 100644 --- a/plugins/twitch/macro-action-twitch.cpp +++ b/plugins/twitch/macro-action-twitch.cpp @@ -305,7 +305,7 @@ void MacroActionTwitch::LogAction() const { auto it = actionTypes.find(_action); if (it != actionTypes.end()) { - vblog(LOG_INFO, "performed action \"%s\" with token for \"%s\"", + ablog(LOG_INFO, "performed action \"%s\" with token for \"%s\"", it->second.c_str(), GetWeakTwitchTokenName(_token).c_str()); } else {