summaryrefslogtreecommitdiffstats
path: root/apps/higet/higet.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apps/higet/higet.cc')
-rw-r--r--apps/higet/higet.cc37
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("/"));