You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rm...@apache.org on 2021/11/28 17:14:31 UTC

[logging-log4cxx] branch LOGCXX-510 updated (76a6d4c -> c7a145f)

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

rmiddleton pushed a change to branch LOGCXX-510
in repository https://gitbox.apache.org/repos/asf/logging-log4cxx.git.


    from 76a6d4c  Updated symbol dump file
     new 56e9987  Made syslogwriter ABI-stable
     new c7a145f  Updated documentation slightly

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/main/cpp/syslogwriter.cpp                   | 24 ++++++++++++++++++------
 src/main/include/log4cxx/helpers/syslogwriter.h |  7 +++----
 src/site/markdown/library-design.md             | 22 ++++++++++++----------
 3 files changed, 33 insertions(+), 20 deletions(-)

[logging-log4cxx] 01/02: Made syslogwriter ABI-stable

Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 56e99877270ff03214d712940b860bada1e41d51
Author: Robert Middleton <ro...@rm5248.com>
AuthorDate: Sun Nov 28 11:28:40 2021 -0500

    Made syslogwriter ABI-stable
---
 src/main/cpp/syslogwriter.cpp                   | 24 ++++++++++++++++++------
 src/main/include/log4cxx/helpers/syslogwriter.h |  7 +++----
 2 files changed, 21 insertions(+), 10 deletions(-)

diff --git a/src/main/cpp/syslogwriter.cpp b/src/main/cpp/syslogwriter.cpp
index b3e9a81..ad8c92e 100644
--- a/src/main/cpp/syslogwriter.cpp
+++ b/src/main/cpp/syslogwriter.cpp
@@ -29,12 +29,22 @@
 using namespace log4cxx;
 using namespace log4cxx::helpers;
 
+struct SyslogWriter::SyslogWriterPrivate {
+	SyslogWriterPrivate(const LogString& syslogHost1, int syslogHostPort1)
+		: syslogHost(syslogHost1), syslogHostPort(syslogHostPort1){}
+
+	LogString syslogHost;
+	int syslogHostPort;
+	InetAddressPtr address;
+	DatagramSocketPtr ds;
+};
+
 SyslogWriter::SyslogWriter(const LogString& syslogHost1, int syslogHostPort1)
-	: syslogHost(syslogHost1), syslogHostPort(syslogHostPort1)
+	: m_priv(std::make_unique<SyslogWriterPrivate>(syslogHost1, syslogHostPort1))
 {
 	try
 	{
-		this->address = InetAddress::getByName(syslogHost1);
+		m_priv->address = InetAddress::getByName(syslogHost1);
 	}
 	catch (UnknownHostException& e)
 	{
@@ -44,7 +54,7 @@ SyslogWriter::SyslogWriter(const LogString& syslogHost1, int syslogHostPort1)
 
 	try
 	{
-		this->ds = DatagramSocketPtr(new DatagramSocket());
+		m_priv->ds = DatagramSocketPtr(new DatagramSocket());
 	}
 	catch (SocketException& e)
 	{
@@ -53,16 +63,18 @@ SyslogWriter::SyslogWriter(const LogString& syslogHost1, int syslogHostPort1)
 	}
 }
 
+SyslogWriter::~SyslogWriter(){}
+
 void SyslogWriter::write(const LogString& source)
 {
-	if (this->ds != 0 && this->address != 0)
+	if (m_priv->ds != 0 && m_priv->address != 0)
 	{
 		LOG4CXX_ENCODE_CHAR(data, source);
 
 		DatagramPacketPtr packet(
 			new DatagramPacket((void*) data.data(), data.length(),
-				address, syslogHostPort));
+				m_priv->address, m_priv->syslogHostPort));
 
-		ds->send(packet);
+		m_priv->ds->send(packet);
 	}
 }
diff --git a/src/main/include/log4cxx/helpers/syslogwriter.h b/src/main/include/log4cxx/helpers/syslogwriter.h
index 2071f01..547459b 100644
--- a/src/main/include/log4cxx/helpers/syslogwriter.h
+++ b/src/main/include/log4cxx/helpers/syslogwriter.h
@@ -41,13 +41,12 @@ class LOG4CXX_EXPORT SyslogWriter
 	public:
 #define SYSLOG_PORT 514
 		SyslogWriter(const LogString& syslogHost, int syslogHostPort = SYSLOG_PORT);
+		~SyslogWriter();
 		void write(const LogString& string);
 
 	private:
-		LogString syslogHost;
-		int syslogHostPort;
-		InetAddressPtr address;
-		DatagramSocketPtr ds;
+		struct SyslogWriterPrivate;
+		std::unique_ptr<SyslogWriterPrivate> m_priv;
 };
 }  // namespace helpers
 } // namespace log4cxx

[logging-log4cxx] 02/02: Updated documentation slightly

Posted by rm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit c7a145fed802a34c654c11377856bdb5ff8faabb
Author: Robert Middleton <ro...@rm5248.com>
AuthorDate: Sun Nov 28 12:11:15 2021 -0500

    Updated documentation slightly
---
 src/site/markdown/library-design.md | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/site/markdown/library-design.md b/src/site/markdown/library-design.md
index ecd90a0..7c3e2dd 100644
--- a/src/site/markdown/library-design.md
+++ b/src/site/markdown/library-design.md
@@ -67,16 +67,16 @@ This can be done to any depth that is required.
 
 ## Example
 
-Parent-private.h:
+parent\_priv.h:
 ```
-#include "Parent.h"
+#include "parent.h"
 
 struct Parent::ParentPrivate{
   int parentVariable;
 };
 ```
 
-Parent.h:
+parent.h:
 ```
 class Parent {
 pubic:
@@ -85,19 +85,21 @@ pubic:
   virtual ~Parent();
 
 protected:
-  std::unique_ptr<AppenderSkeletonPrivate> m_priv;
+  std::unique_ptr<ParentPrivate> m_priv;
 };
 ```
 
-Parent.cpp:
+parent.cpp:
 ```
+#include "parent_priv.h"
+
 Parent::Parent( std::unique_ptr<ParentPrivate> priv ) :
   m_priv( std::move(priv) ){}
 ```
 
-Child.h:
+child.h:
 ```
-#include "Parent.h"
+#include "parent.h"
 
 class Child : public Parent {
 public:
@@ -111,10 +113,10 @@ private:
 };
 ```
 
-Child.cpp:
+child.cpp:
 ```
-#include "Parent-private.h"
-#include "Child.h"
+#include "parent_priv.h"
+#include "child.h"
 
 struct Child::ChildPriv : public Parent::ParentPriv {
   int childVariable;