mirror of
https://github.com/onyx-and-iris/vmrcli.git
synced 2026-04-07 17:33:33 +00:00
-D flag changed to -l flag. It now expects a string. (DEBUG, INFO etc)
-v flag now prints the cli version new flag -e prints extra console info new flag -f, prevents the CLI from splitting strings on spaces. This allows users to pass string requests containing spaces (setting devices, naming channel labels etc)
This commit is contained in:
24
src/util.c
24
src/util.c
@@ -12,6 +12,7 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "util.h"
|
||||
#include "log.h"
|
||||
|
||||
/**
|
||||
* @brief Removes the last part of a path
|
||||
@@ -28,6 +29,29 @@ void remove_last_part_of_path(char *fullpath)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Gets log level as int from string
|
||||
* @param level Log level as string
|
||||
* @return int Log level as int, or -1 if not found
|
||||
*/
|
||||
int log_level_from_string(const char *level)
|
||||
{
|
||||
if (strcmp(level, "TRACE") == 0)
|
||||
return LOG_TRACE;
|
||||
else if (strcmp(level, "DEBUG") == 0)
|
||||
return LOG_DEBUG;
|
||||
else if (strcmp(level, "INFO") == 0)
|
||||
return LOG_INFO;
|
||||
else if (strcmp(level, "WARN") == 0)
|
||||
return LOG_WARN;
|
||||
else if (strcmp(level, "ERROR") == 0)
|
||||
return LOG_ERROR;
|
||||
else if (strcmp(level, "FATAL") == 0)
|
||||
return LOG_FATAL;
|
||||
else
|
||||
return -1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Converts Voicemeeter's kind into a string.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user