From 582e9a1b4275d89b02d020e1155ee8a0aff65d3b Mon Sep 17 00:00:00 2001 From: "Enrico Loparco (eloparco)" Date: Mon, 19 Sep 2022 08:37:30 +0000 Subject: refactor(logs): use glog instead of prints Ref: HICN-788 Signed-off-by: Enrico Loparco (eloparco) Change-Id: Iedf75e1658a335985cc2dfd7b82ae61124f2371e --- apps/higet/higet.cc | 37 +++++++++++++++++-------------------- 1 file changed, 17 insertions(+), 20 deletions(-) (limited to 'apps/higet/higet.cc') diff --git a/apps/higet/higet.cc b/apps/higet/higet.cc index d72d7d74f..c86f05f12 100644 --- a/apps/higet/higet.cc +++ b/apps/higet/higet.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Cisco and/or its affiliates. + * Copyright (c) 2021-2022 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -13,6 +13,7 @@ * limitations under the License. */ +#include #include #include @@ -172,7 +173,7 @@ class ReadBytesCallbackImplementation } print_bar(100, 100, true); - std::cout << "\nDownloaded " << bytes << " bytes" << std::endl; + LoggerInfo() << "\nDownloaded " << bytes << " bytes"; } work_.reset(); }); @@ -216,8 +217,7 @@ class ReadBytesCallbackImplementation } } if (last) { - std::cout << "] " << int(progress * 100.0) << " %" << std::endl - << std::endl; + std::cout << "] " << int(progress * 100.0) << " %"; } else { std::cout << "] " << int(progress * 100.0) << " %\r"; std::cout.flush(); @@ -250,20 +250,17 @@ long checkFileStatus(std::string file_name) { } void usage(char *program_name) { - std::cerr << "usage:" << std::endl; - std::cerr << program_name << " [option]... [url]..." << std::endl; - std::cerr << program_name << " options:" << std::endl; - std::cerr - << "-O = write documents to " - << std::endl; - std::cerr << "-S = print server response" - << std::endl; - std::cerr << "-P = first word of the ipv6 name of " - "the response" - << std::endl; - std::cerr << "example:" << std::endl; - std::cerr << "\t" << program_name << " -O - http://origin/index.html" - << std::endl; + LoggerInfo() << "usage:"; + LoggerInfo() << program_name << " [option]... [url]..."; + LoggerInfo() << program_name << " options:"; + LoggerInfo() + << "-O = write documents to "; + LoggerInfo() << "-S = print server response"; + LoggerInfo() + << "-P = first word of the ipv6 name of " + "the response"; + LoggerInfo() << "example:"; + LoggerInfo() << "\t" << program_name << " -O - http://origin/index.html"; exit(EXIT_FAILURE); } @@ -308,8 +305,8 @@ int main(int argc, char **argv) { } name = argv[optind]; - std::cerr << "Using name " << name << " and name first word " - << conf.ipv6_first_word << std::endl; + LoggerInfo() << "Using name " << name << " and name first word " + << conf.ipv6_first_word; if (conf.file_name.empty()) { conf.file_name = name.substr(1 + name.find_last_of("/")); -- cgit 1.2.3-korg