This makes the function compatible with parse_debug().
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Michael Adam <obnox@samba.org>
*/
#include <replace.h>
+#include <system/locale.h>
#include "common/logging.h"
{
int i;
+ if (isdigit(log_string[0])) {
+ int level = atoi(log_string);
+
+ if (level >= 0 && level < ARRAY_SIZE(log_string_map)) {
+ *log_level = debug_level_from_int(level);
+ return true;
+ }
+ return false;
+ }
+
for (i=0; i<ARRAY_SIZE(log_string_map); i++) {
if (strncasecmp(log_string_map[i].log_string,
log_string, strlen(log_string)) == 0) {