Explorar el Código

Add file for json_layout. Implementation to follow.

Sam Jaffe hace 6 años
padre
commit
aee5017b92
Se han modificado 2 ficheros con 25 adiciones y 0 borrados
  1. 4 0
      logger.xcodeproj/project.pbxproj
  2. 21 0
      src/loggers/json_layout.cxx

+ 4 - 0
logger.xcodeproj/project.pbxproj

@@ -27,6 +27,7 @@
 		CD88E95F2252D3EF00927F40 /* c_logger.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD88E95D2252D3EF00927F40 /* c_logger.cxx */; };
 		CD88E9632252D67A00927F40 /* common.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD88E9612252D67A00927F40 /* common.cxx */; };
 		CDA494DE2256D5F40041620C /* date_format.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CDA494DD2256D5F40041620C /* date_format.cxx */; };
+		CDEA62D5225A3B0B00A6FAE0 /* json_layout.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CDEA62D4225A3B0B00A6FAE0 /* json_layout.cxx */; };
 /* End PBXBuildFile section */
 
 /* Begin PBXContainerItemProxy section */
@@ -95,6 +96,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>"; };
+		CDEA62D4225A3B0B00A6FAE0 /* json_layout.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = json_layout.cxx; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -144,6 +146,7 @@
 			children = (
 				CD1CDE862252E5B900E5B6B2 /* properties.cxx */,
 				CD1CDEB42256C94000E5B6B2 /* pattern_layout.cxx */,
+				CDEA62D4225A3B0B00A6FAE0 /* json_layout.cxx */,
 				CD1CDEB022557FB600E5B6B2 /* default_layout.cxx */,
 				CD1CDE8A2252E61800E5B6B2 /* console_appender.cxx */,
 				CD1CDE882252E60900E5B6B2 /* file_appender.cxx */,
@@ -347,6 +350,7 @@
 			buildActionMask = 2147483647;
 			files = (
 				CD29739B1D7B401F00E37217 /* logger.cxx in Sources */,
+				CDEA62D5225A3B0B00A6FAE0 /* json_layout.cxx in Sources */,
 				CD88E9572252BDFC00927F40 /* log_manager.cxx in Sources */,
 				CDA494DE2256D5F40041620C /* date_format.cxx in Sources */,
 				CD3C80C01D6A2CA300ACC795 /* format.cxx in Sources */,

+ 21 - 0
src/loggers/json_layout.cxx

@@ -0,0 +1,21 @@
+//
+//  json_layout.cxx
+//  logging
+//
+//  Created by Sam Jaffe on 4/7/19.
+//
+
+#include "logger/properties.h"
+
+using namespace logging;
+
+using namespace logging::property;
+properties const DEFAULT_JSON_LAYOUT{_obj({
+  {"charset", _v("en_US.UTF-8")},
+  {"compact", _v(false)},
+  {"eventEol", _v(false)},
+  {"complete", _v(false)},
+  {"locationInfo", _v(false)},
+  {"includeNullDelimiter", _v(false)},
+  {"objectMessageAsJsonObject", _v(false)}
+})};