Skip to content

Commit a4fa696

Browse files
committed
Raise default log level to INFO, disable less important messages in builds without debug logging
1 parent 24655a3 commit a4fa696

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

src/api_config.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ void api_config::load_from_file(const std::string &filename) {
7676
INI pt;
7777
if (!filename.empty()) {
7878
std::ifstream infile(filename);
79-
if (infile.good()) pt.load(infile);
79+
if (infile.good()) {
80+
LOG_F(INFO, "Loading configuration from %s", filename.c_str());
81+
pt.load(infile);
82+
}
8083
}
8184

8285
// read out the [ports] parameters
@@ -206,7 +209,7 @@ void api_config::load_from_file(const std::string &filename) {
206209
force_default_timestamps_ = pt.get("tuning.ForceDefaultTimestamps", false);
207210

208211
// read the [log] settings
209-
int log_level = pt.get("log.level", -1);
212+
int log_level = pt.get("log.level", (int) loguru::Verbosity_INFO);
210213
if (log_level < -3 || log_level > 9)
211214
throw std::runtime_error("Invalid log.level (valid range: -3 to 9");
212215

src/common.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void lsl::ensure_lsl_initialized() {
4141
if (!is_initialized) {
4242
is_initialized = true;
4343

44-
loguru::g_stderr_verbosity = loguru::Verbosity_WARNING;
44+
loguru::g_stderr_verbosity = loguru::Verbosity_INFO;
4545
#ifdef LOGURU_DEBUG_LOGGING
4646
// Initialize loguru, mainly to print stacktraces on segmentation faults
4747
int argc = 1;

src/tcp_server.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ void client_session::handle_read_query_outcome(error_code err) {
329329
/* keep the client_session alive until the shortinfo is sent completely*/
330330
});
331331
} else
332-
LOG_F(INFO, "%p got a shortinfo query response for the wrong query", this);
332+
DLOG_F(INFO, "%p got a shortinfo query response for the wrong query", this);
333333
}
334334
} catch (std::exception &e) {
335335
LOG_F(WARNING, "Unexpected error while parsing a client request: %s", e.what());
@@ -356,7 +356,7 @@ void client_session::handle_read_feedparams(
356356
send_status_message(
357357
"LSL/" + std::to_string(api_config::get_instance()->use_protocol_version()) +
358358
" 505 Version not supported");
359-
LOG_F(INFO, "%p Got a request for a too new protocol version", this);
359+
DLOG_F(INFO, "%p Got a request for a too new protocol version", this);
360360
return;
361361
}
362362
if (!request_uid.empty() && request_uid != serv_->info_->uid()) {

src/udp_server.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ void udp_server::handle_receive_outcome(error_code err, std::size_t len) {
136136
});
137137
return;
138138
} else {
139-
LOG_F(INFO, "%p Got shortinfo query for mismatching query string: %s", this,
139+
DLOG_F(INFO, "%p Got shortinfo query for mismatching query string: %s", this,
140140
query.c_str());
141141
}
142142
} else if (time_services_enabled_ && method == "LSL:timedata") {

0 commit comments

Comments
 (0)