Add cfg.log.events=false by default ##config

This commit is contained in:
pancake 2019-01-13 03:31:40 +01:00 committed by radare
parent 2c8d417d65
commit 46955f69d5
5 changed files with 18 additions and 3 deletions

View File

@ -1407,6 +1407,13 @@ static int cb_hex_hdroff(void *user, void *data) {
return true;
}
static int cb_log_events (void *user, void *data) {
RCore *core = (RCore *) user;
RConfigNode *node = (RConfigNode *) data;
core->log_events = node->i_value;
return true;
}
static int cb_hexcomments(void *user, void *data) {
RCore *core = (RCore *) user;
RConfigNode *node = (RConfigNode *) data;
@ -2838,6 +2845,8 @@ R_API int r_core_config_init(RCore *core) {
SETCB ("cfg.log.colors", p ? p : "false", cb_log_config_colors, "Should the log output use colors (TODO)");
free (p);
SETCB ("cfg.log.events", "false", &cb_log_events, "Remote HTTP server to sync events with");
// zign
SETPREF ("zign.prefix", "sign", "Default prefix for zignatures matches");
SETI ("zign.maxsz", 500, "Maximum zignature length");

View File

@ -2,7 +2,8 @@
#include <r_core.h>
static int cmd_colon(RCore *core, const char *cmd) {
static int cmd_colon(void *_core, const char *cmd) {
// RCore *core = (RCore*)_core;
if (*cmd == '{') {
// parse json here, and retrieve arguments
return 1;

View File

@ -205,8 +205,8 @@ static int log_callback_all (RCore *log, int count, const char *line) {
}
static void http_sync_thread(void *user, char *out) {
RCore *core = (RCore *)user;
eprintf ("Sync\n");
//RCore *core = (RCore *)user;
//r_core_task_sleep_begin (user);
//r_core_break (user);
}
@ -251,7 +251,7 @@ static int cmd_log(void *data, const char *input) {
case '?': // "T?"
r_core_cmd_help (core, help_msg_T);
break;
case 'T': // Ts ? as ms?
case 'T': // "TT" Ts ? as ms?
if (r_config_get_i (core->config, "scr.interactive")) {
textlog_chat (core);
} else {

View File

@ -2212,6 +2212,10 @@ static char *get_comments_cb(void *user, ut64 addr) {
}
static void cb_event_handler(REvent *ev, REventType event_type, void *data) {
RCore *core = (RCore *)ev->user;
if (!core->log_events) {
return;
}
REventMeta *rems = data;
char *str = r_base64_encode_dyn (rems->string, -1);
switch (event_type) {

View File

@ -297,6 +297,7 @@ typedef struct r_core_t {
REvent *ev;
RList *gadgets;
bool scr_gadgets;
bool log_events; // core.c:cb_event_handler : log actions from events if cfg.log.events is set
} RCore;
R_API int r_core_bind(RCore *core, RCoreBind *bnd);