Add log level which prints performed actions

This commit is contained in:
WarmUpTill 2024-03-02 00:48:06 +01:00 committed by WarmUpTill
parent 9acbead87b
commit ab0cce9eaa
56 changed files with 144 additions and 94 deletions

View File

@ -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"

View File

@ -163,12 +163,31 @@
<item>
<layout class="QHBoxLayout" name="horizontalLayout_52">
<item>
<widget class="QCheckBox" name="verboseLogging">
<widget class="QLabel" name="label_21">
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.verboseLogging</string>
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="logLevel">
<item>
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel.default</string>
</property>
</item>
<item>
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel.printActions</string>
</property>
</item>
<item>
<property name="text">
<string>AdvSceneSwitcher.generalTab.generalBehavior.logLevel.verbose</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_49">
<property name="orientation">
@ -5078,7 +5097,7 @@
<tabstop>checkInterval</tabstop>
<tabstop>startupBehavior</tabstop>
<tabstop>autoStartEvent</tabstop>
<tabstop>verboseLogging</tabstop>
<tabstop>logLevel</tabstop>
<tabstop>saveWindowGeo</tabstop>
<tabstop>showTrayNotifications</tabstop>
<tabstop>uiHintsDisable</tabstop>

View File

@ -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);

View File

@ -112,6 +112,14 @@ void AdvSceneSwitcher::on_startupBehavior_currentIndexChanged(int index)
static_cast<SwitcherData::StartupBehavior>(index);
}
void AdvSceneSwitcher::on_logLevel_currentIndexChanged(int value)
{
if (loading) {
return;
}
switcher->logLevel = static_cast<SwitcherData::LogLevel>(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<int>(autoStartEvent));
obs_data_set_bool(obj, "verbose", verbose);
obs_data_set_int(obj, "logLevel", static_cast<int>(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<AutoStart>(obs_data_get_int(obj, "autoStartEvent"));
verbose = obs_data_get_bool(obj, "verbose");
logLevel = static_cast<LogLevel>(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<int>(switcher->logLevel));
ui->saveWindowGeo->setChecked(switcher->saveWindowGeo);
ui->showTrayNotifications->setChecked(
switcher->showSystemTrayNotifications);

View File

@ -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();
}

View File

@ -119,7 +119,7 @@ bool SwitcherData::checkExeSwitch(OBSWeakSource &scene,
scene = s.getScene();
transition = s.transition;
if (verbose) {
if (VerboseLoggingEnabled()) {
s.logMatch();
}
break;

View File

@ -274,7 +274,7 @@ bool SwitcherData::checkFileContent(OBSWeakSource &scene,
transition = s.transition;
match = true;
if (verbose) {
if (VerboseLoggingEnabled()) {
s.logMatch();
}
break;

View File

@ -53,7 +53,7 @@ bool SwitcherData::checkIdleSwitch(OBSWeakSource &scene,
match = true;
idleData.alreadySwitched = true;
if (verbose) {
if (VerboseLoggingEnabled()) {
idleData.logMatch();
}
} else {

View File

@ -193,7 +193,7 @@ bool SwitcherData::checkMediaSwitch(OBSWeakSource &scene,
scene = mediaSwitch.getScene();
transition = mediaSwitch.transition;
if (verbose) {
if (VerboseLoggingEnabled()) {
mediaSwitch.logMatch();
}
}

View File

@ -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());
}
}

View File

@ -76,7 +76,7 @@ bool SwitcherData::checkRandom(OBSWeakSource &scene, OBSWeakSource &transition,
lastRandomScene = r.scene;
lastRandomSceneGroup = r.group;
if (verbose) {
if (VerboseLoggingEnabled()) {
r.logMatch();
}
break;

View File

@ -183,7 +183,7 @@ bool SwitcherData::checkScreenRegionSwitch(OBSWeakSource &scene,
transition = s.transition;
minRegionSize = regionSize;
if (verbose) {
if (VerboseLoggingEnabled()) {
s.logMatch();
}
break;

View File

@ -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();
}

View File

@ -142,7 +142,7 @@ bool SwitcherData::checkTimeSwitch(OBSWeakSource &scene,
transition = s.transition;
match = true;
if (verbose) {
if (VerboseLoggingEnabled()) {
s.logMatch();
}
break;

View File

@ -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<std::string, QWidget *> widgetPlaceholders = {
{"{{scenes}}", scenes}, {"{{transitions}}", transitions}};
{"{{scenes}}", scenes},
{"{{transitions}}", transitions}};
PlaceWidgets(
obs_module_text(
"AdvSceneSwitcher.transitionTab.defaultTransitionEntry"),

View File

@ -148,7 +148,7 @@ bool SwitcherData::checkVideoSwitch(OBSWeakSource &scene,
match = true;
scene = s.getScene();
transition = s.transition;
if (verbose) {
if (VerboseLoggingEnabled()) {
s.logMatch();
}
}

View File

@ -249,7 +249,7 @@ bool SwitcherData::checkWindowTitleSwitch(OBSWeakSource &scene,
}
if (match) {
if (verbose) {
if (VerboseLoggingEnabled()) {
s.logMatch();
}
break;

View File

@ -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:

View File

@ -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:

View File

@ -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)

View File

@ -141,7 +141,9 @@ public:
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 --- */

View File

@ -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();
}
}

View File

@ -5,7 +5,16 @@ 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

View File

@ -3,14 +3,26 @@
namespace advss {
// Print log with "[adv-ss] " prefix
#define blog(level, msg, ...) blog(level, "[adv-ss] " msg, ##__VA_ARGS__)
// Print log with "[adv-ss] " if log level is set to "verbose"
#define vblog(level, msg, ...) \
do { \
if (VerboseLoggingEnabled()) { \
blog(level, msg, ##__VA_ARGS__); \
} \
} while (0)
// Print log with "[adv-ss] " if log level is set to "action" or "verbose"
#define ablog(level, msg, ...) \
do { \
if (ActionLoggingEnabled()) { \
blog(level, msg, ##__VA_ARGS__); \
} \
} while (0)
// Returns true if log level is set to "verbose"
EXPORT bool VerboseLoggingEnabled();
// Returns true if log level is set to "action" or "verbose"
EXPORT bool ActionLoggingEnabled();
} // namespace advss

View File

@ -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());

View File

@ -47,7 +47,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",

View File

@ -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());

View File

@ -371,7 +371,7 @@ bool MacroActionHotkey::PerformAction()
void MacroActionHotkey::LogAction() const
{
vblog(LOG_INFO, "sent hotkey type %d", static_cast<int>(_action));
ablog(LOG_INFO, "sent hotkey type %d", static_cast<int>(_action));
}
bool MacroActionHotkey::Save(obs_data_t *obj) const

View File

@ -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 {

View File

@ -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()

View File

@ -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());

View File

@ -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",

View File

@ -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

View File

@ -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\","

View File

@ -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

View File

@ -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<int>(_action));

View File

@ -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<int>(_action));

View File

@ -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

View File

@ -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());
}

View File

@ -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());

View File

@ -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());

View File

@ -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());
}

View File

@ -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<int>(_action), _source.ToString(true).c_str(),
_scene.ToString(true).c_str());

View File

@ -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());

View File

@ -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;
}
}

View File

@ -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());

View File

@ -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",

View File

@ -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<int>(_action));

View File

@ -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",

View File

@ -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());
}

View File

@ -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());

View File

@ -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());
}
}

View File

@ -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<int>(_action));

View File

@ -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;

View File

@ -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());
}

View File

@ -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 {