Exemplo n.º 1
0
void debug_ctx_journal_dump( uint8_t ctx_id )
{
	net_ctx_t *ctx = NULL;

	if( ctx_id > _max_ctx - 1 ) return;

	ctx = net_ctx_find_by_id( ctx_id );

	if( ! ctx) return;

	logging_printf( LOGGING_DEBUG, "Journal has data: %s\n", ( journal_has_data( ctx->journal ) ? "YES" : "NO" ) );

	if( ! journal_has_data( ctx->journal ) ) return;

	journal_dump( ctx->journal );
}
Exemplo n.º 2
0
static void
journal_main(struct gctl_req *req, unsigned flags)
{
	const char *name;

	if ((flags & G_FLAG_VERBOSE) != 0)
		verbose = 1;

	name = gctl_get_ascii(req, "verb");
	if (name == NULL) {
		gctl_error(req, "No '%s' argument.", "verb");
		return;
	}
	if (strcmp(name, "label") == 0)
		journal_label(req);
	else if (strcmp(name, "clear") == 0)
		journal_clear(req);
	else if (strcmp(name, "dump") == 0)
		journal_dump(req);
	else
		gctl_error(req, "Unknown command: %s.", name);
}