diff options
author | Enrico Loparco (eloparco) <eloparco@cisco.com> | 2022-09-19 08:37:30 +0000 |
---|---|---|
committer | Enrico Loparco <eloparco@cisco.com> | 2022-09-21 08:11:14 +0000 |
commit | 582e9a1b4275d89b02d020e1155ee8a0aff65d3b (patch) | |
tree | 78c3a86e4359f888ffa1450ffd753815fc5e9d20 /apps/higet/higet.cc | |
parent | 10e0758a2124e8d9d6253a9160e593303b38f71e (diff) |
refactor(logs): use glog instead of prints
Ref: HICN-788
Signed-off-by: Enrico Loparco (eloparco) <eloparco@cisco.com>
Change-Id: Iedf75e1658a335985cc2dfd7b82ae61124f2371e
Diffstat (limited to 'apps/higet/higet.cc')
-rw-r--r-- | apps/higet/higet.cc | 37 |
1 files changed, 17 insertions, 20 deletions
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 <hicn/apps/utils/logger.h> #include <hicn/transport/http/client_connection.h> #include <hicn/transport/utils/chrono_typedefs.h> @@ -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 <out_put_path> = write documents to <out_put_file>" - << 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 <out_put_path> = write documents to <out_put_file>"; + 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("/")); |