You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
353 B

  1. #include <glog/logging.h>
  2. int main(int argc, char* argv[]) {
  3. // 初始化glog
  4. google::InitGoogleLogging(argv[0]);
  5. // 设置日志级别
  6. FLAGS_logtostderr = 1;
  7. // 记录日志
  8. LOG(INFO) << "This is an info message";
  9. LOG(WARNING) << "This is a warning message";
  10. LOG(ERROR) << "This is an error message";
  11. return 0;
  12. }