mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-13 20:16:07 -05:00
Add log level which prints performed actions
This commit is contained in:
@@ -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());
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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\","
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user