Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Explanation/ Documentation #18

Open
alboainin opened this issue May 1, 2020 · 3 comments
Open

More Explanation/ Documentation #18

alboainin opened this issue May 1, 2020 · 3 comments

Comments

@alboainin
Copy link

I'm trying to implement it to my project but I'm facing difficulties due to the improper documentation and the functions that are not explained in it.

@pzibang
Copy link

pzibang commented Nov 29, 2020

set the leveland enable the quiet,if you want to write log into file, do that as follow:

int main(int argc, char *argv[])
{
    log_set_level(0);
    log_set_quiet(0);
    FILE *fp;
    fp = fopen("./log.txt", "ab");
    if(fp == NULL)
    {
        return -1;
    }
    log_set_fp(fp);

    log_debug("debug");
    log_info("info");
    log_warn("warn");

    fclose(fp);
    return 0;
}

@parhamsagharchi
Copy link

set the leveland enable the quiet,if you want to write log into file, do that as follow:

int main(int argc, char *argv[])
{
    log_set_level(0);
    log_set_quiet(0);
    FILE *fp;
    fp = fopen("./log.txt", "ab");
    if(fp == NULL)
    {
        return -1;
    }
    log_set_fp(fp);

    log_debug("debug");
    log_info("info");
    log_warn("warn");

    fclose(fp);
    return 0;
}

you should change log_set_fp(fp); into log_add_fp(fp, 0);

@aditya18007
Copy link

aditya18007 commented Dec 16, 2021

I have created a C template project https://github.com/aditya18007/template-c-project . This might be helpful in understanding logging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants