Пример #1
0
static int
logging_init (glusterfs_ctx_t *ctx)
{
    cmd_args_t *cmd_args = NULL;
    int         ret = 0;

    cmd_args = &ctx->cmd_args;

    if (cmd_args->log_file == NULL) {
        ret = set_log_file_path (cmd_args);
        if (ret == -1) {
            fprintf (stderr, "failed to set the log file path.. "
                     "exiting\n");
            return -1;
        }
    }

    if (gf_log_init (cmd_args->log_file) == -1) {
        fprintf (stderr,
                 "failed to open logfile %s.  exiting\n",
                 cmd_args->log_file);
        return -1;
    }

    gf_log_set_loglevel (cmd_args->log_level);

    return 0;
}
Пример #2
0
Media_logger::Media_logger()
{
#if defined(MEDIA_TRACE_FILE) || defined(MEDIA_TRACE_CONSOLE)
    set_log_file_path(TRACE_FILE_PATH);
#endif
}