Use the default debug hook if possible
This commit is contained in:
+1
-1
@@ -124,7 +124,7 @@ int command_getopt(char **arg)
|
||||
}
|
||||
continue;
|
||||
case 'v':
|
||||
dbg_level = atoi(optarg);
|
||||
dbg_default_set_level(atoi(optarg));
|
||||
continue;
|
||||
default:
|
||||
*arg = optarg;
|
||||
|
||||
@@ -18,27 +18,6 @@
|
||||
|
||||
#include <debug.h>
|
||||
|
||||
/**
|
||||
* Default debug level
|
||||
*/
|
||||
int dbg_level = 1;
|
||||
|
||||
/**
|
||||
* Logging to stderr with configurable debug level
|
||||
*/
|
||||
void dbg_pki(int level, char *fmt, ...)
|
||||
{
|
||||
if (level <= dbg_level)
|
||||
{
|
||||
va_list args;
|
||||
|
||||
va_start(args, fmt);
|
||||
vfprintf(stderr, fmt, args);
|
||||
fprintf(stderr, "\n");
|
||||
va_end(args);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert a form string to a encoding type
|
||||
*/
|
||||
@@ -101,8 +80,6 @@ hash_algorithm_t get_digest(char *name)
|
||||
*/
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
dbg = dbg_pki;
|
||||
|
||||
atexit(library_deinit);
|
||||
if (!library_init(NULL))
|
||||
{
|
||||
|
||||
@@ -26,11 +26,6 @@
|
||||
#include <library.h>
|
||||
#include <credentials/keys/private_key.h>
|
||||
|
||||
/**
|
||||
* Defines the settable debug level
|
||||
*/
|
||||
extern int dbg_level;
|
||||
|
||||
/**
|
||||
* Convert a form string to a encoding type
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user