EC_LOG_TYPE_REGISTER(3)

NAME
ec_log_type_register - Register a named log type.

SYNOPSIS
#include <ecoli/log.h>

int ec_log_type_register(
    struct ec_log_type   *type   /* The log type to register. */
);

DESCRIPTION

Register a new log type, which is identified by its name. The function returns a log identifier associated with the log name. If the name is already registered, the function just returns its identifier.

STRUCTURES
A structure describing a log type.

It is defined as a static structure by the EC_LOG_TYPE_REGISTER() macro.

struct ec_log_type {

    enum   level;

    int    id;
};

RETURN VALUE

The log type identifier on success (positive or zero), -1 on error (errno is set).

SEE ALSO

ec_log_fct_register(3), ec_log_level_set(3), ec_vlog(3), ec_log_level_get(3), ec_log_name(3), ec_log(3), ec_log_default_cb(3),

COPYRIGHT

Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.