You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
ZmqLogger: default AppendDebugMethod()'s extra params
Give the AppendDebugMethod() declaration a set of default values for
all parameters after the first. (It uses `""` and `-1.0`, which are
what callers were passing in anyway.) This way, callers have the
_option_ to eschew this kind of thing:
```
ZmqLogger::Instance()->AppendDebugMethod("Message", "start", start,
"length", length, "", -1, "", -1, "", -1, "", -1);
```
instead, they can use the functionally equivalent:
```
ZmqLogger::Instance()->AppendDebugMethod("Message", "start", start,
"length", length);
```
Passing meaningless args is the compiler's job, not the programmer's.
This commit is contained in:
@@ -96,12 +96,13 @@ namespace openshot {
|
||||
static ZmqLogger * Instance();
|
||||
|
||||
/// Append debug information
|
||||
void AppendDebugMethod(string method_name, string arg1_name, float arg1_value,
|
||||
string arg2_name, float arg2_value,
|
||||
string arg3_name, float arg3_value,
|
||||
string arg4_name, float arg4_value,
|
||||
string arg5_name, float arg5_value,
|
||||
string arg6_name, float arg6_value);
|
||||
void AppendDebugMethod(std::string method_name,
|
||||
std::string arg1_name="", float arg1_value=-0.0,
|
||||
std::string arg2_name="", float arg2_value=-0.0,
|
||||
std::string arg3_name="", float arg3_value=-0.0,
|
||||
std::string arg4_name="", float arg4_value=-0.0,
|
||||
std::string arg5_name="", float arg5_value=-0.0,
|
||||
std::string arg6_name="", float arg6_value=-0.0);
|
||||
|
||||
/// Close logger (sockets and/or files)
|
||||
void Close();
|
||||
|
||||
@@ -162,12 +162,13 @@ void ZmqLogger::Close()
|
||||
}
|
||||
|
||||
// Append debug information
|
||||
void ZmqLogger::AppendDebugMethod(string method_name, string arg1_name, float arg1_value,
|
||||
string arg2_name, float arg2_value,
|
||||
string arg3_name, float arg3_value,
|
||||
string arg4_name, float arg4_value,
|
||||
string arg5_name, float arg5_value,
|
||||
string arg6_name, float arg6_value)
|
||||
void ZmqLogger::AppendDebugMethod(string method_name,
|
||||
string arg1_name, float arg1_value,
|
||||
string arg2_name, float arg2_value,
|
||||
string arg3_name, float arg3_value,
|
||||
string arg4_name, float arg4_value,
|
||||
string arg5_name, float arg5_value,
|
||||
string arg6_name, float arg6_value)
|
||||
{
|
||||
if (!enabled)
|
||||
// Don't do anything
|
||||
@@ -206,4 +207,4 @@ void ZmqLogger::AppendDebugMethod(string method_name, string arg1_name, float ar
|
||||
// Send message through ZMQ
|
||||
Log(message.str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user