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

Failed to print INFO and WARNING log #533

Closed
GOGOYAO opened this issue Mar 13, 2020 · 1 comment
Closed

Failed to print INFO and WARNING log #533

GOGOYAO opened this issue Mar 13, 2020 · 1 comment

Comments

@GOGOYAO
Copy link

GOGOYAO commented Mar 13, 2020

I use glog 0.3.4 and my test code is :

#include <iostream>
#include <chrono>
#include <thread>
#include <string.h>
#include <stdio.h>

#include <glog/logging.h>

int main(int argc, char** argv) {
    google::ParseCommandLineFlags(&argc, &argv, true);
    google::InitGoogleLogging(argv[0]);
    std::cout << FLAGS_minloglevel << std::endl;
    LOG(INFO) << "GLOG";
    LOG(WARNING) << "GLOG";
    LOG(ERROR) << "GLOG";
}

Then I run

g++ -I /usr/local/include/ -L /usr/local/lib/ -lglog -lgflags test.cpp && ./a.out -minloglevel=1
g++ -I /usr/local/include/ -L /usr/local/lib/ -lglog -lgflags test.cpp && ./a.out -minloglevel=2
g++ -I /usr/local/include/ -L /usr/local/lib/ -lglog -lgflags test.cpp && ./a.out -minloglevel=3

But only ERROR log is printted in those three tests.

@GOGOYAO
Copy link
Author

GOGOYAO commented Mar 13, 2020

I see the --logtostderr or --alsologtostderr can solve this issue

@GOGOYAO GOGOYAO closed this as completed Mar 13, 2020
@sergiud sergiud mentioned this issue May 6, 2021
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

1 participant