incremental
diff --git a/include/ast_jpeg_decoder.hpp b/include/ast_jpeg_decoder.hpp
index 6e5a3d4..b5144ab 100644
--- a/include/ast_jpeg_decoder.hpp
+++ b/include/ast_jpeg_decoder.hpp
@@ -6,7 +6,6 @@
#include <ast_video_types.hpp>
#include <cassert>
#include <cstdint>
-#include <g3log/g3log.hpp>
#include <iostream>
#include <vector>
diff --git a/include/ast_video_puller.hpp b/include/ast_video_puller.hpp
index fd29ca5..6575d7e 100644
--- a/include/ast_video_puller.hpp
+++ b/include/ast_video_puller.hpp
@@ -2,7 +2,6 @@
#include <assert.h>
#include <ast_video_types.hpp>
-#include <g3log/g3log.hpp>
#include <iostream>
#include <mutex>
#include <vector>
@@ -96,13 +95,13 @@
std::cout << "Write done\n";
*/
- LOG(DEBUG) << "Reading\n";
+ std::cout << "Reading\n";
status = read(video_fd, reinterpret_cast<char *>(&image_info),
sizeof(image_info));
- LOG(DEBUG) << "Done reading\n";
+ std::cout << "Done reading\n";
if (status != 0) {
- LOG(WARNING) << "Read failed with status " << status << "\n";
+ std::cerr << "Read failed with status " << status << "\n";
}
raw.buffer.resize(image_info.len);
@@ -150,7 +149,7 @@
dev_video, mutable_buffer, [this](const boost::system::error_code &ec,
std::size_t bytes_transferred) {
if (ec) {
- LOG(WARNING) << "Read failed with status " << ec << "\n";
+ std::cerr << "Read failed with status " << ec << "\n";
} else {
this->read_done();
}
@@ -158,7 +157,7 @@
}
void read_done() {
- LOG(DEBUG) << "Done reading\n";
+ std::cout << "Done reading\n";
videobuf->buffer.resize(image_info.len);
videobuf->height = image_info.parameter.features.h;
diff --git a/include/crow/g3_logger.hpp b/include/crow/g3_logger.hpp
index 91e2935..7dfedde 100644
--- a/include/crow/g3_logger.hpp
+++ b/include/crow/g3_logger.hpp
@@ -68,10 +68,10 @@
#define CROW_LOG_CRITICAL \
if (!CROW_DISABLE_LOGGING) LOG(FATAL)
#define CROW_LOG_ERROR \
- if (!CROW_DISABLE_LOGGING) LOG(WARNING)
+ if (!CROW_DISABLE_LOGGING) std::cerr
#define CROW_LOG_WARNING \
- if (!CROW_DISABLE_LOGGING) LOG(WARNING)
+ if (!CROW_DISABLE_LOGGING) std::cerr
#define CROW_LOG_INFO \
if (!CROW_DISABLE_LOGGING) LOG(INFO)
#define CROW_LOG_DEBUG \
- if (!CROW_DISABLE_LOGGING) LOG(DEBUG)
+ if (!CROW_DISABLE_LOGGING) std::cout
diff --git a/include/ssl_key_handler.hpp b/include/ssl_key_handler.hpp
index aade3fb..4948025 100644
--- a/include/ssl_key_handler.hpp
+++ b/include/ssl_key_handler.hpp
@@ -11,7 +11,6 @@
#include <openssl/rand.h>
#include <openssl/rsa.h>
#include <openssl/ssl.h>
-#include <g3log/g3log.hpp>
#include <random>
#include <boost/asio.hpp>
@@ -26,7 +25,7 @@
bool private_key_valid = false;
bool cert_valid = false;
- LOG(DEBUG) << "Checking certs in file " << filepath;
+ std::cout << "Checking certs in file " << filepath << "\n";
FILE *file = fopen(filepath.c_str(), "r");
if (file != NULL) {
@@ -35,21 +34,21 @@
if (pkey) {
RSA *rsa = EVP_PKEY_get1_RSA(pkey);
if (rsa) {
- LOG(DEBUG) << "Found an RSA key";
+ std::cout << "Found an RSA key\n";
if (RSA_check_key(rsa) == 1) {
// private_key_valid = true;
} else {
- LOG(WARNING) << "Key not valid error number " << ERR_get_error();
+ std::cerr << "Key not valid error number " << ERR_get_error() << "\n";
}
RSA_free(rsa);
} else {
EC_KEY *ec = EVP_PKEY_get1_EC_KEY(pkey);
if (ec) {
- LOG(DEBUG) << "Found an EC key";
+ std::cout << "Found an EC key\n";
if (EC_KEY_check_key(ec) == 1) {
private_key_valid = true;
} else {
- LOG(WARNING) << "Key not valid error number " << ERR_get_error();
+ std::cerr << "Key not valid error number " << ERR_get_error() << "\n";
}
EC_KEY_free(ec);
}
@@ -58,14 +57,14 @@
if (private_key_valid) {
X509 *x509 = PEM_read_X509(file, NULL, NULL, NULL);
if (!x509) {
- LOG(DEBUG) << "error getting x509 cert " << ERR_get_error();
+ std::cout << "error getting x509 cert " << ERR_get_error() << "\n";
} else {
rc = X509_verify(x509, pkey);
if (rc == 1) {
cert_valid = true;
} else {
- LOG(WARNING) << "Error in verifying private key signature "
- << ERR_get_error();
+ std::cerr << "Error in verifying private key signature "
+ << ERR_get_error() << "\n";
}
}
}
@@ -79,16 +78,16 @@
inline void generate_ssl_certificate(const std::string &filepath) {
FILE *pFile = NULL;
- LOG(WARNING) << "Generating new keys";
+ std::cout << "Generating new keys\n";
init_openssl();
- // LOG(WARNING) << "Generating RSA key";
+ // std::cerr << "Generating RSA key";
// EVP_PKEY *pRsaPrivKey = create_rsa_key();
- LOG(WARNING) << "Generating EC key";
+ std::cerr << "Generating EC key\n";
EVP_PKEY *pRsaPrivKey = create_ec_key();
if (pRsaPrivKey) {
- LOG(WARNING) << "Generating x509 Certificate";
+ std::cerr << "Generating x509 Certificate\n";
// Use this code to directly generate a certificate
X509 *x509;
x509 = X509_new();
@@ -221,7 +220,7 @@
pem_file_valid = verify_openssl_key_cert(filepath);
if (!pem_file_valid) {
- LOG(WARNING) << "Error in verifying signature, regenerating";
+ std::cerr << "Error in verifying signature, regenerating\n";
generate_ssl_certificate(filepath);
}
}
diff --git a/include/web_kvm.hpp b/include/web_kvm.hpp
index 1671382..3d33347 100644
--- a/include/web_kvm.hpp
+++ b/include/web_kvm.hpp
@@ -205,7 +205,7 @@
bool is_binary) {
switch (meta.vnc_state) {
case VncState::AWAITING_CLIENT_VERSION: {
- LOG(DEBUG) << "Client sent: " << data;
+ std::cout << "Client sent: " << data;
if (data == rfb_3_8_version_string ||
data == rfb_3_7_version_string) {
std::string auth_types{1,
@@ -248,20 +248,20 @@
server_init_msg.pixel_format.green_shift = 8;
server_init_msg.pixel_format.blue_shift = 0;
server_init_msg.name_length = 0;
- LOG(DEBUG) << "size: " << sizeof(server_init_msg);
+ std::cout << "size: " << sizeof(server_init_msg);
// TODO(ed) this is ugly. Crow should really have a span type
// interface
// to avoid the copy, but alas, today it does not.
std::string s(reinterpret_cast<char*>(&server_init_msg),
sizeof(server_init_msg));
- LOG(DEBUG) << "s.size() " << s.size();
+ std::cout << "s.size() " << s.size();
conn.send_binary(s);
meta.vnc_state = VncState::MAIN_LOOP;
} break;
case VncState::MAIN_LOOP: {
if (data.size() >= sizeof(client_to_server_msg_type)) {
auto type = static_cast<client_to_server_msg_type>(data[0]);
- LOG(DEBUG) << "Received client message type " << (uint32_t)type
+ std::cout << "Received client message type " << (uint32_t)type
<< "\n";
switch (type) {
case client_to_server_msg_type::set_pixel_format: {
@@ -301,10 +301,10 @@
this_rect.height = out.height;
this_rect.encoding =
static_cast<uint8_t>(encoding_type::raw);
- LOG(DEBUG) << "Encoding is " << this_rect.encoding;
+ std::cout << "Encoding is " << this_rect.encoding;
this_rect.data.reserve(this_rect.width * this_rect.height *
4);
- LOG(DEBUG) << "Width " << out.width << " Height "
+ std::cout << "Width " << out.width << " Height "
<< out.height;
for (int i = 0; i < out.width * out.height; i++) {