mirror of
https://github.com/radareorg/radare2.git
synced 2024-12-01 17:40:34 +00:00
Add cfg.log.events=false by default ##config
This commit is contained in:
parent
2c8d417d65
commit
46955f69d5
@ -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");
|
||||
|
@ -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;
|
||||
|
@ -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 {
|
||||
|
@ -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) {
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user