mirror of
https://github.com/ElementsProject/lightning.git
synced 2024-11-19 18:11:28 +01:00
dd35260ce8
Logging code based heavily on pettycoin's. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
26 lines
591 B
C
26 lines
591 B
C
#include "lightningd.h"
|
|
#include "log.h"
|
|
#include <ccan/tal/tal.h>
|
|
#include <sys/types.h>
|
|
#include <unistd.h>
|
|
|
|
static struct lightningd_state *lightningd_state(void)
|
|
{
|
|
struct lightningd_state *state = tal(NULL, struct lightningd_state);
|
|
|
|
state->log_record = new_log_record(state, 20 * 1024 * 1024, LOG_INFORM);
|
|
state->base_log = new_log(state, state->log_record,
|
|
"lightningd(%u):", (int)getpid());
|
|
|
|
return state;
|
|
}
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
struct lightningd_state *state = lightningd_state();
|
|
|
|
log_info(state->base_log, "Hello world!");
|
|
tal_free(state);
|
|
return 0;
|
|
}
|