This commit is contained in:
Uwe Seimet 2021-08-25 13:39:08 +02:00
parent 355816964d
commit 1b0032c25f
3 changed files with 14 additions and 14 deletions

View File

@ -61,7 +61,7 @@ int monsocket; // Monitor Socket
pthread_t monthread; // Monitor Thread
pthread_mutex_t ctrl_mutex; // Semaphore for the ctrl array
static void *MonThread(void *param);
vector<string> available_log_levels;
vector<string> log_levels;
string current_log_level; // Some versions of spdlog do not support get_log_level()
string default_image_folder;
set<string> files_in_use;
@ -519,8 +519,8 @@ void LogDevices(const string& devices)
void GetLogLevels(PbServerInfo& serverInfo)
{
for (auto it = available_log_levels.begin(); it != available_log_levels.end(); ++it) {
serverInfo.add_available_log_levels(*it);
for (auto it = log_levels.begin(); it != log_levels.end(); ++it) {
serverInfo.add_log_levels(*it);
}
}
@ -1245,13 +1245,13 @@ int main(int argc, char* argv[])
setvbuf(stdout, NULL, _IONBF, 0);
struct sched_param schparam;
available_log_levels.push_back("trace");
available_log_levels.push_back("debug");
available_log_levels.push_back("info");
available_log_levels.push_back("warn");
available_log_levels.push_back("err");
available_log_levels.push_back("critical");
available_log_levels.push_back("off");
log_levels.push_back("trace");
log_levels.push_back("debug");
log_levels.push_back("info");
log_levels.push_back("warn");
log_levels.push_back("err");
log_levels.push_back("critical");
log_levels.push_back("off");
SetLogLevel("info");
// Create a thread-safe stdout logger to process the log messages

View File

@ -148,7 +148,7 @@ message PbResult {
message PbServerInfo {
string rascsi_version = 1;
// Sorted by severity
repeated string available_log_levels = 2;
repeated string log_levels = 2;
string current_log_level = 3;
string default_image_folder = 4;
// Supported device types and their properties

View File

@ -181,13 +181,13 @@ void CommandServerInfo(const string& hostname, int port)
cout << "rascsi server version: " << serverInfo.rascsi_version() << endl;
if (!serverInfo.available_log_levels_size()) {
if (!serverInfo.log_levels_size()) {
cout << " No log level settings available" << endl;
}
else {
cout << "rascsi log levels, sorted by severity:" << endl;
for (int i = 0; i < serverInfo.available_log_levels_size(); i++) {
cout << " " << serverInfo.available_log_levels(i) << endl;
for (int i = 0; i < serverInfo.log_levels_size(); i++) {
cout << " " << serverInfo.log_levels(i) << endl;
}
cout << "Current rascsi log level: " << serverInfo.current_log_level() << endl;