Control plugin: add ability to switch log levels interactively

This commit is contained in:
Alexey Rybalchenko
2018-05-09 16:12:04 +02:00
committed by Mohammad Al-Turany
parent 2a6e4de72c
commit 436f79bee5
5 changed files with 35 additions and 3 deletions

View File

@@ -170,6 +170,7 @@ void Monitor::Interactive()
struct termios t;
tcgetattr(STDIN_FILENO, &t); // get the current terminal I/O structure
t.c_lflag &= ~ICANON; // disable canonical input
t.c_lflag &= ~ECHO; // do not echo input chars
tcsetattr(STDIN_FILENO, TCSANOW, &t); // apply the new settings
cout << endl;
@@ -238,6 +239,7 @@ void Monitor::Interactive()
tcgetattr(STDIN_FILENO, &t); // get the current terminal I/O structure
t.c_lflag |= ICANON; // re-enable canonical input
t.c_lflag |= ECHO; // echo input chars
tcsetattr(STDIN_FILENO, TCSANOW, &t); // apply the new settings
}