You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by sw...@apache.org on 2023/12/13 02:23:32 UTC

(logging-log4cxx) 01/01: Simplify console example

This is an automated email from the ASF dual-hosted git repository.

swebb2066 pushed a commit to branch declutter_examples_more
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git

commit 3b575cc1beb391ade91f76e839dc460157726039
Author: Stephen Webb <sw...@gmail.com>
AuthorDate: Wed Dec 13 13:23:01 2023 +1100

    Simplify console example
---
 src/examples/cpp/console.cpp | 15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)

diff --git a/src/examples/cpp/console.cpp b/src/examples/cpp/console.cpp
index 99e5ab76..d0688a42 100644
--- a/src/examples/cpp/console.cpp
+++ b/src/examples/cpp/console.cpp
@@ -15,20 +15,14 @@
  * limitations under the License.
  */
 
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
 #include <log4cxx/logger.h>
 #include <log4cxx/consoleappender.h>
 #include <log4cxx/simplelayout.h>
 #include <log4cxx/logmanager.h>
-#include <iostream>
-#include <locale.h>
-#include <cstring>
+#include <locale>
 #include <cstdio>
-#ifndef WIN32
-#include <stdint.h>
-#endif
+#include <cstring>
+#include <iostream>
 
 /**
  *   Configures console appender.
@@ -43,9 +37,6 @@ static void configure(bool err)
             ( std::make_shared<SimpleLayout>()
             , err ? ConsoleAppender::getSystemErr() : ConsoleAppender::getSystemOut()
             );
-        appender->setName(LOG4CXX_STR("console"));
-        helpers::Pool pool;
-        appender->activateOptions(pool);
         r->getRootLogger()->addAppender(appender);
     });
 }