aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/config/controlSetDebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'hicn-light/src/hicn/config/controlSetDebug.c')
-rw-r--r--hicn-light/src/hicn/config/controlSetDebug.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/hicn-light/src/hicn/config/controlSetDebug.c b/hicn-light/src/hicn/config/controlSetDebug.c
index 75e0e5a44..a5dcc89c1 100644
--- a/hicn-light/src/hicn/config/controlSetDebug.c
+++ b/hicn-light/src/hicn/config/controlSetDebug.c
@@ -29,10 +29,14 @@
#include <hicn/core/forwarder.h>
static CommandReturn _controlSetDebug_Execute(CommandParser *parser,
- CommandOps *ops, PARCList *args);
+ CommandOps *ops, PARCList *args,
+ char *output,
+ size_t output_size);
static CommandReturn _controlSetDebug_HelpExecute(CommandParser *parser,
CommandOps *ops,
- PARCList *args);
+ PARCList *args,
+ char *output,
+ size_t output_size);
static const char *_commandSetDebug = "set debug";
static const char *_commandSetDebugHelp = "help set debug";
@@ -53,21 +57,25 @@ CommandOps *controlSetDebug_HelpCreate(ControlState *state) {
static CommandReturn _controlSetDebug_HelpExecute(CommandParser *parser,
CommandOps *ops,
- PARCList *args) {
- printf("set debug: will enable the debug flag for more verbose output\n");
- printf("\n");
+ PARCList *args,
+ char *output,
+ size_t output_size) {
+ snprintf(output, output_size, "set debug: will enable the debug flag for more verbose output\n");
return CommandReturn_Success;
}
static CommandReturn _controlSetDebug_Execute(CommandParser *parser,
- CommandOps *ops, PARCList *args) {
+ CommandOps *ops,
+ PARCList *args,
+ char *output,
+ size_t output_size) {
if (parcList_Size(args) != 2) {
- _controlSetDebug_HelpExecute(parser, ops, args);
+ _controlSetDebug_HelpExecute(parser, ops, args, output, output_size);
return CommandReturn_Failure;
}
ControlState *state = ops->closure;
controlState_SetDebug(state, true);
- printf("Debug flag set\n\n");
+ snprintf(output, output_size, "Debug flag set\n\n");
return CommandReturn_Success;
}