int cmd_verb(const char *arg) { const char *verb; if (strlen(arg) < 5) { cmd_verb_help(); return 1; } verb = arg + 5; if (strcmp(verb, "error") == 0) { ly_verb(0); } else if (strcmp(verb, "warning") == 0) { ly_verb(1); } else if (strcmp(verb, "verbose") == 0) { ly_verb(2); } else if (strcmp(verb, "debug") == 0) { ly_verb(3); } else { fprintf(stderr, "Unknown verbosity \"%s\"\n", verb); return 1; } return 0; }
void CodecServiceProvider::initialize_root_schema(const std::string & bundle_name, path::Repository & repo) { YLOG_DEBUG("Initializing root schema for {}", bundle_name); ly_verb(LY_LLSILENT); //turn off libyang logging at the beginning IetfCapabilitiesParser capabilities_parser{}; std::vector<std::string> empty_caps; auto yang_caps = capabilities_parser.parse(empty_caps); auto root_schema = repo.create_root_schema(get_global_capabilities_lookup_tables(), yang_caps); std::string s{bundle_name}; std::pair<std::string, std::shared_ptr<path::RootSchemaNode>> entry {s, root_schema}; m_root_schema_table.insert(entry); ly_verb(LY_LLVRB); // enable libyang logging after payload has been created }