Browse Source

Remove some unhelpful headers. Move logger_impl into the source-code section since it's not a public header.

Sam Jaffe 6 years ago
parent
commit
36bc60f74b

+ 0 - 21
include/logger/detail/to_json.h

@@ -1,21 +0,0 @@
-//
-//  to_json.h
-//  logger
-//
-//  Created by Sam Jaffe on 4/4/19.
-//
-
-#pragma once
-
-#include <string>
-
-#include <json/json.h>
-
-namespace logging { namespace detail {
-  template <typename T> std::string to_string(T const & obj);
-  
-  template <typename T>
-  Json::Value to_json(T const & obj) {
-    return to_string(obj);
-  }
-} }

+ 0 - 25
include/logger/detail/to_string.h

@@ -1,25 +0,0 @@
-//
-//  to_string.h
-//  logger
-//
-//  Created by Sam Jaffe on 4/4/19.
-//
-
-#pragma once
-
-#include <iostream>
-#include <sstream>
-
-namespace logging { namespace detail {
-  template <typename T>
-  void to_stream(T const & obj, std::ostream & os) {
-    os << obj;
-  }
-
-  template <typename T>
-  std::string to_string(T const & obj) {
-    std::stringstream ss;
-    to_stream(obj, ss);
-    return ss.str();
-  }
-} }

+ 18 - 2
include/logger/wrapper_object.h

@@ -9,9 +9,9 @@
 
 #include <iostream>
 #include <string>
+#include <sstream>
 
-#include "detail/to_string.h"
-#include "detail/to_json.h"
+#include <json/json.h>
 
 namespace logging { namespace detail {
   class object {
@@ -33,6 +33,22 @@ namespace logging { namespace detail {
     Json::Value (*to_json_)(void*);
   };
   
+  template <typename T>
+  void to_stream(T const & obj, std::ostream & os) {
+    os << obj;
+  }
+  
+  template <typename T>
+  std::string to_string(T const & obj) {
+    std::stringstream ss;
+    to_stream(obj, ss);
+    return ss.str();
+  }
+  
+  template <typename T>
+  Json::Value to_json(T const & obj) {
+    return to_string(obj);
+  }
   
   template <typename T>
   std::string object::to_string_impl(void * ptr) {

+ 2 - 0
logger.xcodeproj/project.pbxproj

@@ -107,6 +107,7 @@
 		CD88E9612252D67A00927F40 /* common.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = common.cxx; sourceTree = "<group>"; };
 		CD88E9642252D6C700927F40 /* common.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
 		CDA494DD2256D5F40041620C /* date_format.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = date_format.cxx; sourceTree = "<group>"; };
+		CDC0E0472267EA30001EDAB7 /* logger_impl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = logger_impl.h; sourceTree = "<group>"; };
 		CDEA62D4225A3B0B00A6FAE0 /* json_layout.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = json_layout.cxx; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
@@ -173,6 +174,7 @@
 				CD1CDE812252E54100E5B6B2 /* loggers */,
 				CD88E95D2252D3EF00927F40 /* c_logger.cxx */,
 				CD2973991D7B401F00E37217 /* logger.cxx */,
+				CDC0E0472267EA30001EDAB7 /* logger_impl.h */,
 				CD1CDEAE22556B7E00E5B6B2 /* logger_impl.cxx */,
 				CD88E9552252BDFC00927F40 /* log_manager.cxx */,
 				CD88E9642252D6C700927F40 /* common.h */,

+ 1 - 1
src/log_manager.cxx

@@ -16,10 +16,10 @@
 #include "common.h"
 #include "logger/c_logger.h"
 #include "logger/detail/appender.h"
+#include "logger/detail/logger_impl.h"
 #include "logger/exception.h"
 #include "logger/logger.h"
 #include "logger/properties.h"
-#include "logger_impl.h"
 
 INSTANTIATE_PROTOTYPE_FACTORY_2(logging::appenders);
 INSTANTIATE_PROTOTYPE_FACTORY_2(logging::layouts);

+ 1 - 1
src/logger_impl.cxx

@@ -5,7 +5,7 @@
 //  Created by Sam Jaffe on 4/3/19.
 //
 
-#include "logger_impl.h"
+#include "logger/detail/logger_impl.h"
 
 #include "common.h"
 #include "logger/detail/appender.h"

include/logger/detail/logger_impl.h → src/logger_impl.h