Skip to content

Commit

Permalink
fix stdout logging (#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
MisterTea authored Jul 31, 2020
1 parent b034e11 commit e81db4e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/terminal/TerminalClientMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ int main(int argc, char** argv) {

// Setup easylogging configurations
el::Configurations defaultConf = LogHandler::setupLogHandler(&argc, &argv);
LogHandler::setupStdoutLogger();

// Parse command line arguments
cxxopts::Options options("et", "Remote shell for the busy and impatient");
Expand Down Expand Up @@ -103,8 +104,6 @@ int main(int argc, char** argv) {
// set thread name
el::Helpers::setThreadName("client-main");

LogHandler::setupStdoutLogger();

// Install log rotation callback
el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler);

Expand Down
5 changes: 1 addition & 4 deletions src/terminal/TerminalMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ void setDaemonLogFile(string idpasskey, string daemonType) {
int main(int argc, char** argv) {
// Setup easylogging configurations
el::Configurations defaultConf = LogHandler::setupLogHandler(&argc, &argv);
LogHandler::setupStdoutLogger();

// Parse command line arguments
cxxopts::Options options("et", "Remote shell for the busy and impatient");
Expand Down Expand Up @@ -148,8 +149,6 @@ int main(int argc, char** argv) {
// Install log rotation callback
el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler);

LogHandler::setupStdoutLogger();

CLOG(INFO, "stdout") << "IDPASSKEY:" << idpasskey << endl;
if (DaemonCreator::createSessionLeader() == -1) {
STFATAL << "Error creating daemon: " << strerror(errno);
Expand Down Expand Up @@ -183,8 +182,6 @@ int main(int argc, char** argv) {
// Install log rotation callback
el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler);

LogHandler::setupStdoutLogger();

SocketEndpoint routerEndpoint;
routerEndpoint.set_name(result["serverfifo"].as<string>());
UserTerminalHandler uth(ipcSocketHandler, term, true, routerEndpoint,
Expand Down
3 changes: 1 addition & 2 deletions src/terminal/TerminalServerMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ using namespace gflags;
int main(int argc, char **argv) {
// Setup easylogging configurations
el::Configurations defaultConf = LogHandler::setupLogHandler(&argc, &argv);
LogHandler::setupStdoutLogger();

cxxopts::Options options("etserver",
"Remote shell for the busy and impatient");
Expand Down Expand Up @@ -137,8 +138,6 @@ int main(int argc, char **argv) {
// Install log rotation callback
el::Helpers::installPreRollOutCallback(LogHandler::rolloutHandler);

LogHandler::setupStdoutLogger();

std::shared_ptr<SocketHandler> tcpSocketHandler(new TcpSocketHandler());
std::shared_ptr<PipeSocketHandler> pipeSocketHandler(
new PipeSocketHandler());
Expand Down
3 changes: 1 addition & 2 deletions test/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ int main(int argc, char **argv) {
// Setup easylogging configurations
el::Configurations defaultConf =
et::LogHandler::setupLogHandler(&argc, &argv);
et::LogHandler::setupStdoutLogger();
defaultConf.setGlobally(el::ConfigurationType::ToStandardOutput, "true");
defaultConf.setGlobally(el::ConfigurationType::ToFile, "true");
// el::Loggers::setVerboseLevel(9);
Expand All @@ -22,8 +23,6 @@ int main(int argc, char **argv) {
// Reconfigure default logger to apply settings above
el::Loggers::reconfigureLogger("default", defaultConf);

et::LogHandler::setupStdoutLogger();

int result = Catch::Session().run(argc, argv);

FATAL_FAIL(::remove(logPath.c_str()));
Expand Down

0 comments on commit e81db4e

Please sign in to comment.