Bladeren bron

Make project properly arranged.
Start making tests.

Sam Jaffe 6 jaren geleden
bovenliggende
commit
bd899d07e4

format.hpp → include/logger/format.hpp


+ 1 - 1
logger.hpp

@@ -30,7 +30,7 @@
 
 namespace logging {
   class logger_impl;
-  typedef logger_impl& (*_binding)(void);
+  typedef std::function<logger_impl&(void)> _binding;
   bool bind_logger_impl(_binding impl);
     
   const char* level_header(log_level);

logger_fwd.hpp → include/logger/logger_fwd.hpp


+ 325 - 63
logger.xcodeproj/project.pbxproj

@@ -8,19 +8,64 @@
 
 /* Begin PBXBuildFile section */
 		CD29739B1D7B401F00E37217 /* logger.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD2973991D7B401F00E37217 /* logger.cpp */; };
-		CD29739C1D7B401F00E37217 /* logger.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD29739A1D7B401F00E37217 /* logger.hpp */; };
 		CD3C80C01D6A2CA300ACC795 /* format.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD3C80BE1D6A2CA300ACC795 /* format.cpp */; };
-		CD3C80C11D6A2CA300ACC795 /* format.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CD3C80BF1D6A2CA300ACC795 /* format.hpp */; };
+		CD6F73EC225187BE0081ED74 /* logger in Headers */ = {isa = PBXBuildFile; fileRef = CD6F73EA225187A10081ED74 /* logger */; settings = {ATTRIBUTES = (Public, ); }; };
+		CD6F7406225187F40081ED74 /* liblogging.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 0ECAC4AF1BC00AC500FDAE14 /* liblogging.dylib */; };
+		CD6F740C225187FD0081ED74 /* logger_test.cxx in Sources */ = {isa = PBXBuildFile; fileRef = CD6F73FC225187E10081ED74 /* logger_test.cxx */; };
+		CD6F742E225189290081ED74 /* libcfmt_logger.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6F742D225189290081ED74 /* libcfmt_logger.dylib */; };
+		CD6F746C22518A2C0081ED74 /* GoogleMock.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CD6F746B22518A2C0081ED74 /* GoogleMock.framework */; };
 /* End PBXBuildFile section */
 
+/* Begin PBXContainerItemProxy section */
+		CD6F7407225187F40081ED74 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = 0EB833411BBF45E600DDC844 /* Project object */;
+			proxyType = 1;
+			remoteGlobalIDString = 0ECAC4AE1BC00AC500FDAE14;
+			remoteInfo = logging;
+		};
+		CD6F7436225189470081ED74 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 05818F861A685AEA0072A469;
+			remoteInfo = GoogleMock;
+		};
+		CD6F7438225189470081ED74 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 05E96ABD1A68600C00204102;
+			remoteInfo = gmock;
+		};
+		CD6F743A225189470081ED74 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 05E96B1F1A68634900204102;
+			remoteInfo = gtest;
+		};
+		CD6F743C225189470081ED74 /* PBXContainerItemProxy */ = {
+			isa = PBXContainerItemProxy;
+			containerPortal = CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */;
+			proxyType = 2;
+			remoteGlobalIDString = 05818F901A685AEA0072A469;
+			remoteInfo = GoogleMockTests;
+		};
+/* End PBXContainerItemProxy section */
+
 /* Begin PBXFileReference section */
 		0EB833481BBF45E600DDC844 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = "<group>"; };
 		0ECAC4AF1BC00AC500FDAE14 /* liblogging.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; includeInIndex = 0; path = liblogging.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
 		CD2973991D7B401F00E37217 /* logger.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = logger.cpp; sourceTree = "<group>"; };
-		CD29739A1D7B401F00E37217 /* logger.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = logger.hpp; sourceTree = "<group>"; };
-		CD29739D1D7B40C600E37217 /* logger_fwd.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = logger_fwd.hpp; sourceTree = "<group>"; };
 		CD3C80BE1D6A2CA300ACC795 /* format.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = format.cpp; sourceTree = "<group>"; };
-		CD3C80BF1D6A2CA300ACC795 /* format.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = format.hpp; sourceTree = "<group>"; };
+		CD6F73EA225187A10081ED74 /* logger */ = {isa = PBXFileReference; lastKnownFileType = folder; name = logger; path = include/logger; sourceTree = "<group>"; };
+		CD6F73FC225187E10081ED74 /* logger_test.cxx */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = logger_test.cxx; sourceTree = "<group>"; };
+		CD6F7401225187F40081ED74 /* logger_test.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = logger_test.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
+		CD6F7405225187F40081ED74 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
+		CD6F742D225189290081ED74 /* libcfmt_logger.dylib */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.dylib"; path = libcfmt_logger.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
+		CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = GoogleMock.xcodeproj; path = "../../../gmock-xcode-master/GoogleMock.xcodeproj"; sourceTree = "<group>"; };
+		CD6F746B22518A2C0081ED74 /* GoogleMock.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GoogleMock.framework; path = "../../../gmock-xcode-master/build/Release/GoogleMock.framework"; sourceTree = "<group>"; };
 /* End PBXFileReference section */
 
 /* Begin PBXFrameworksBuildPhase section */
@@ -28,6 +73,16 @@
 			isa = PBXFrameworksBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
+				CD6F742E225189290081ED74 /* libcfmt_logger.dylib in Frameworks */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+		CD6F73FE225187F40081ED74 /* Frameworks */ = {
+			isa = PBXFrameworksBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CD6F7406225187F40081ED74 /* liblogging.dylib in Frameworks */,
+				CD6F746C22518A2C0081ED74 /* GoogleMock.framework in Frameworks */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -37,9 +92,13 @@
 		0EB833401BBF45E600DDC844 = {
 			isa = PBXGroup;
 			children = (
+				CD6F73EA225187A10081ED74 /* logger */,
 				CD2973971D7B3FC600E37217 /* src */,
 				0EB833481BBF45E600DDC844 /* Makefile */,
+				CD6F73EB225187B30081ED74 /* test */,
+				CD6F7402225187F40081ED74 /* logger_test */,
 				0EB8335A1BBF484800DDC844 /* Products */,
+				CD6F742B225188600081ED74 /* Frameworks */,
 			);
 			sourceTree = "<group>";
 		};
@@ -47,6 +106,7 @@
 			isa = PBXGroup;
 			children = (
 				0ECAC4AF1BC00AC500FDAE14 /* liblogging.dylib */,
+				CD6F7401225187F40081ED74 /* logger_test.xctest */,
 			);
 			name = Products;
 			sourceTree = "<group>";
@@ -54,13 +114,47 @@
 		CD2973971D7B3FC600E37217 /* src */ = {
 			isa = PBXGroup;
 			children = (
-				CD29739D1D7B40C600E37217 /* logger_fwd.hpp */,
 				CD2973991D7B401F00E37217 /* logger.cpp */,
-				CD29739A1D7B401F00E37217 /* logger.hpp */,
 				CD3C80BE1D6A2CA300ACC795 /* format.cpp */,
-				CD3C80BF1D6A2CA300ACC795 /* format.hpp */,
 			);
-			name = src;
+			path = src;
+			sourceTree = "<group>";
+		};
+		CD6F73EB225187B30081ED74 /* test */ = {
+			isa = PBXGroup;
+			children = (
+				CD6F73FC225187E10081ED74 /* logger_test.cxx */,
+			);
+			path = test;
+			sourceTree = "<group>";
+		};
+		CD6F7402225187F40081ED74 /* logger_test */ = {
+			isa = PBXGroup;
+			children = (
+				CD6F7405225187F40081ED74 /* Info.plist */,
+			);
+			path = logger_test;
+			sourceTree = "<group>";
+		};
+		CD6F742B225188600081ED74 /* Frameworks */ = {
+			isa = PBXGroup;
+			children = (
+				CD6F746B22518A2C0081ED74 /* GoogleMock.framework */,
+				CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */,
+				CD6F742D225189290081ED74 /* libcfmt_logger.dylib */,
+			);
+			name = Frameworks;
+			sourceTree = "<group>";
+		};
+		CD6F7430225189470081ED74 /* Products */ = {
+			isa = PBXGroup;
+			children = (
+				CD6F7437225189470081ED74 /* GoogleMock.framework */,
+				CD6F7439225189470081ED74 /* gmock.framework */,
+				CD6F743B225189470081ED74 /* gtest.framework */,
+				CD6F743D225189470081ED74 /* GoogleMockTests.xctest */,
+			);
+			name = Products;
 			sourceTree = "<group>";
 		};
 /* End PBXGroup section */
@@ -70,30 +164,12 @@
 			isa = PBXHeadersBuildPhase;
 			buildActionMask = 2147483647;
 			files = (
-				CD29739C1D7B401F00E37217 /* logger.hpp in Headers */,
-				CD3C80C11D6A2CA300ACC795 /* format.hpp in Headers */,
+				CD6F73EC225187BE0081ED74 /* logger in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
 /* End PBXHeadersBuildPhase section */
 
-/* Begin PBXLegacyTarget section */
-		0EB833451BBF45E600DDC844 /* logger */ = {
-			isa = PBXLegacyTarget;
-			buildArgumentsString = "$(ACTION)";
-			buildConfigurationList = 0EB833491BBF45E600DDC844 /* Build configuration list for PBXLegacyTarget "logger" */;
-			buildPhases = (
-			);
-			buildToolPath = /usr/bin/make;
-			buildWorkingDirectory = "/Users/leumasjaffe/Documents/Programming/XTools Workspace/C:C++/misc/logger";
-			dependencies = (
-			);
-			name = logger;
-			passBuildSettingsInEnvironment = 1;
-			productName = logger;
-		};
-/* End PBXLegacyTarget section */
-
 /* Begin PBXNativeTarget section */
 		0ECAC4AE1BC00AC500FDAE14 /* logging */ = {
 			isa = PBXNativeTarget;
@@ -112,17 +188,40 @@
 			productReference = 0ECAC4AF1BC00AC500FDAE14 /* liblogging.dylib */;
 			productType = "com.apple.product-type.library.dynamic";
 		};
+		CD6F7400225187F40081ED74 /* logger_test */ = {
+			isa = PBXNativeTarget;
+			buildConfigurationList = CD6F7409225187F40081ED74 /* Build configuration list for PBXNativeTarget "logger_test" */;
+			buildPhases = (
+				CD6F73FD225187F40081ED74 /* Sources */,
+				CD6F73FE225187F40081ED74 /* Frameworks */,
+				CD6F73FF225187F40081ED74 /* Resources */,
+			);
+			buildRules = (
+			);
+			dependencies = (
+				CD6F7408225187F40081ED74 /* PBXTargetDependency */,
+			);
+			name = logger_test;
+			productName = logger_test;
+			productReference = CD6F7401225187F40081ED74 /* logger_test.xctest */;
+			productType = "com.apple.product-type.bundle.unit-test";
+		};
 /* End PBXNativeTarget section */
 
 /* Begin PBXProject section */
 		0EB833411BBF45E600DDC844 /* Project object */ = {
 			isa = PBXProject;
 			attributes = {
-				LastUpgradeCheck = 0720;
+				LastSwiftUpdateCheck = 1010;
+				LastUpgradeCheck = 1000;
 				TargetAttributes = {
 					0ECAC4AE1BC00AC500FDAE14 = {
 						CreatedOnToolsVersion = 7.0.1;
 					};
+					CD6F7400225187F40081ED74 = {
+						CreatedOnToolsVersion = 10.1;
+						ProvisioningStyle = Automatic;
+					};
 				};
 			};
 			buildConfigurationList = 0EB833441BBF45E600DDC844 /* Build configuration list for PBXProject "logger" */;
@@ -135,14 +234,61 @@
 			mainGroup = 0EB833401BBF45E600DDC844;
 			productRefGroup = 0EB8335A1BBF484800DDC844 /* Products */;
 			projectDirPath = "";
+			projectReferences = (
+				{
+					ProductGroup = CD6F7430225189470081ED74 /* Products */;
+					ProjectRef = CD6F742F225189470081ED74 /* GoogleMock.xcodeproj */;
+				},
+			);
 			projectRoot = "";
 			targets = (
-				0EB833451BBF45E600DDC844 /* logger */,
 				0ECAC4AE1BC00AC500FDAE14 /* logging */,
+				CD6F7400225187F40081ED74 /* logger_test */,
 			);
 		};
 /* End PBXProject section */
 
+/* Begin PBXReferenceProxy section */
+		CD6F7437225189470081ED74 /* GoogleMock.framework */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.framework;
+			path = GoogleMock.framework;
+			remoteRef = CD6F7436225189470081ED74 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+		CD6F7439225189470081ED74 /* gmock.framework */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.framework;
+			path = gmock.framework;
+			remoteRef = CD6F7438225189470081ED74 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+		CD6F743B225189470081ED74 /* gtest.framework */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.framework;
+			path = gtest.framework;
+			remoteRef = CD6F743A225189470081ED74 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+		CD6F743D225189470081ED74 /* GoogleMockTests.xctest */ = {
+			isa = PBXReferenceProxy;
+			fileType = wrapper.cfbundle;
+			path = GoogleMockTests.xctest;
+			remoteRef = CD6F743C225189470081ED74 /* PBXContainerItemProxy */;
+			sourceTree = BUILT_PRODUCTS_DIR;
+		};
+/* End PBXReferenceProxy section */
+
+/* Begin PBXResourcesBuildPhase section */
+		CD6F73FF225187F40081ED74 /* Resources */ = {
+			isa = PBXResourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
+/* End PBXResourcesBuildPhase section */
+
 /* Begin PBXSourcesBuildPhase section */
 		0ECAC4AB1BC00AC500FDAE14 /* Sources */ = {
 			isa = PBXSourcesBuildPhase;
@@ -153,53 +299,92 @@
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
+		CD6F73FD225187F40081ED74 /* Sources */ = {
+			isa = PBXSourcesBuildPhase;
+			buildActionMask = 2147483647;
+			files = (
+				CD6F740C225187FD0081ED74 /* logger_test.cxx in Sources */,
+			);
+			runOnlyForDeploymentPostprocessing = 0;
+		};
 /* End PBXSourcesBuildPhase section */
 
+/* Begin PBXTargetDependency section */
+		CD6F7408225187F40081ED74 /* PBXTargetDependency */ = {
+			isa = PBXTargetDependency;
+			target = 0ECAC4AE1BC00AC500FDAE14 /* logging */;
+			targetProxy = CD6F7407225187F40081ED74 /* PBXContainerItemProxy */;
+		};
+/* End PBXTargetDependency section */
+
 /* Begin XCBuildConfiguration section */
 		0EB833421BBF45E600DDC844 /* Debug */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = NO;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
 				ENABLE_TESTABILITY = YES;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				ONLY_ACTIVE_ARCH = YES;
 				SDKROOT = macosx;
+				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/ $(PROJECT_DIR)/../../paradigm/declarative/expect/include/";
 			};
 			name = Debug;
 		};
 		0EB833431BBF45E600DDC844 /* Release */ = {
 			isa = XCBuildConfiguration;
 			buildSettings = {
+				CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
+				CLANG_WARN_BOOL_CONVERSION = YES;
+				CLANG_WARN_COMMA = YES;
+				CLANG_WARN_CONSTANT_CONVERSION = YES;
+				CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
+				CLANG_WARN_EMPTY_BODY = YES;
+				CLANG_WARN_ENUM_CONVERSION = YES;
+				CLANG_WARN_INFINITE_RECURSION = YES;
+				CLANG_WARN_INT_CONVERSION = YES;
+				CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
+				CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
+				CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
+				CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
+				CLANG_WARN_STRICT_PROTOTYPES = YES;
+				CLANG_WARN_SUSPICIOUS_MOVE = YES;
+				CLANG_WARN_UNREACHABLE_CODE = YES;
+				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
 				COPY_PHASE_STRIP = YES;
+				ENABLE_STRICT_OBJC_MSGSEND = YES;
+				GCC_NO_COMMON_BLOCKS = YES;
+				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
 				GCC_WARN_ABOUT_RETURN_TYPE = YES;
+				GCC_WARN_UNDECLARED_SELECTOR = YES;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES;
+				GCC_WARN_UNUSED_FUNCTION = YES;
 				GCC_WARN_UNUSED_VARIABLE = YES;
 				SDKROOT = macosx;
-			};
-			name = Release;
-		};
-		0EB8334A1BBF45E600DDC844 /* Debug */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = NO;
-				DEBUGGING_SYMBOLS = YES;
-				GCC_DYNAMIC_NO_PIC = NO;
-				GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
-				GCC_OPTIMIZATION_LEVEL = 0;
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = "";
-				PRODUCT_NAME = logger;
-			};
-			name = Debug;
-		};
-		0EB8334B1BBF45E600DDC844 /* Release */ = {
-			isa = XCBuildConfiguration;
-			buildSettings = {
-				COPY_PHASE_STRIP = YES;
-				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
-				OTHER_CFLAGS = "";
-				OTHER_LDFLAGS = "";
-				PRODUCT_NAME = logger;
+				USER_HEADER_SEARCH_PATHS = "$(PROJECT_DIR)/include/ $(PROJECT_DIR)/../../paradigm/declarative/expect/include/";
 			};
 			name = Release;
 		};
@@ -247,7 +432,7 @@
 				MACOSX_DEPLOYMENT_TARGET = 10.10;
 				MTL_ENABLE_DEBUG_INFO = YES;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				USER_HEADER_SEARCH_PATHS = ..;
+				USER_HEADER_SEARCH_PATHS = "../../**";
 			};
 			name = Debug;
 		};
@@ -291,7 +476,84 @@
 				MACOSX_DEPLOYMENT_TARGET = 10.10;
 				MTL_ENABLE_DEBUG_INFO = NO;
 				PRODUCT_NAME = "$(TARGET_NAME)";
-				USER_HEADER_SEARCH_PATHS = ..;
+				USER_HEADER_SEARCH_PATHS = "../../**";
+			};
+			name = Release;
+		};
+		CD6F740A225187F40081ED74 /* Debug */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_IDENTITY = "-";
+				CODE_SIGN_STYLE = Automatic;
+				COMBINE_HIDPI_IMAGES = YES;
+				DEBUG_INFORMATION_FORMAT = dwarf;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_DYNAMIC_NO_PIC = NO;
+				GCC_OPTIMIZATION_LEVEL = 0;
+				GCC_PREPROCESSOR_DEFINITIONS = (
+					"DEBUG=1",
+					"$(inherited)",
+				);
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				INFOPLIST_FILE = logger_test/Info.plist;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+				MACOSX_DEPLOYMENT_TARGET = 10.13;
+				MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "leumasjaffe.logger-test";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
+				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+				SWIFT_VERSION = 4.2;
+			};
+			name = Debug;
+		};
+		CD6F740B225187F40081ED74 /* Release */ = {
+			isa = XCBuildConfiguration;
+			buildSettings = {
+				ALWAYS_SEARCH_USER_PATHS = NO;
+				CLANG_ANALYZER_NONNULL = YES;
+				CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
+				CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
+				CLANG_CXX_LIBRARY = "libc++";
+				CLANG_ENABLE_MODULES = YES;
+				CLANG_ENABLE_OBJC_ARC = YES;
+				CLANG_ENABLE_OBJC_WEAK = YES;
+				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
+				CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
+				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
+				CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
+				CODE_SIGN_IDENTITY = "-";
+				CODE_SIGN_STYLE = Automatic;
+				COMBINE_HIDPI_IMAGES = YES;
+				COPY_PHASE_STRIP = NO;
+				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
+				ENABLE_NS_ASSERTIONS = NO;
+				GCC_C_LANGUAGE_STANDARD = gnu11;
+				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
+				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
+				INFOPLIST_FILE = logger_test/Info.plist;
+				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks";
+				MACOSX_DEPLOYMENT_TARGET = 10.13;
+				MTL_ENABLE_DEBUG_INFO = NO;
+				MTL_FAST_MATH = YES;
+				PRODUCT_BUNDLE_IDENTIFIER = "leumasjaffe.logger-test";
+				PRODUCT_NAME = "$(TARGET_NAME)";
+				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
+				SWIFT_VERSION = 4.2;
 			};
 			name = Release;
 		};
@@ -307,20 +569,20 @@
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		0EB833491BBF45E600DDC844 /* Build configuration list for PBXLegacyTarget "logger" */ = {
+		0ECAC4B71BC00AC500FDAE14 /* Build configuration list for PBXNativeTarget "logging" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
-				0EB8334A1BBF45E600DDC844 /* Debug */,
-				0EB8334B1BBF45E600DDC844 /* Release */,
+				0ECAC4B81BC00AC500FDAE14 /* Debug */,
+				0ECAC4B91BC00AC500FDAE14 /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;
 		};
-		0ECAC4B71BC00AC500FDAE14 /* Build configuration list for PBXNativeTarget "logging" */ = {
+		CD6F7409225187F40081ED74 /* Build configuration list for PBXNativeTarget "logger_test" */ = {
 			isa = XCConfigurationList;
 			buildConfigurations = (
-				0ECAC4B81BC00AC500FDAE14 /* Debug */,
-				0ECAC4B91BC00AC500FDAE14 /* Release */,
+				CD6F740A225187F40081ED74 /* Debug */,
+				CD6F740B225187F40081ED74 /* Release */,
 			);
 			defaultConfigurationIsVisible = 0;
 			defaultConfigurationName = Release;

+ 0 - 80
logger.xcodeproj/xcuserdata/samjaffe.xcuserdatad/xcschemes/logger.xcscheme

@@ -1,80 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<Scheme
-   LastUpgradeVersion = "0720"
-   version = "1.3">
-   <BuildAction
-      parallelizeBuildables = "YES"
-      buildImplicitDependencies = "YES">
-      <BuildActionEntries>
-         <BuildActionEntry
-            buildForTesting = "YES"
-            buildForRunning = "YES"
-            buildForProfiling = "YES"
-            buildForArchiving = "YES"
-            buildForAnalyzing = "YES">
-            <BuildableReference
-               BuildableIdentifier = "primary"
-               BlueprintIdentifier = "0EB833451BBF45E600DDC844"
-               BuildableName = "logger"
-               BlueprintName = "logger"
-               ReferencedContainer = "container:logger.xcodeproj">
-            </BuildableReference>
-         </BuildActionEntry>
-      </BuildActionEntries>
-   </BuildAction>
-   <TestAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      shouldUseLaunchSchemeArgsEnv = "YES">
-      <Testables>
-      </Testables>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </TestAction>
-   <LaunchAction
-      buildConfiguration = "Debug"
-      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
-      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
-      launchStyle = "0"
-      useCustomWorkingDirectory = "NO"
-      ignoresPersistentStateOnLaunch = "NO"
-      debugDocumentVersioning = "YES"
-      debugServiceExtension = "internal"
-      allowLocationSimulation = "YES">
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "0EB833451BBF45E600DDC844"
-            BuildableName = "logger"
-            BlueprintName = "logger"
-            ReferencedContainer = "container:logger.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-      <AdditionalOptions>
-      </AdditionalOptions>
-   </LaunchAction>
-   <ProfileAction
-      buildConfiguration = "Release"
-      shouldUseLaunchSchemeArgsEnv = "YES"
-      savedToolIdentifier = ""
-      useCustomWorkingDirectory = "NO"
-      debugDocumentVersioning = "YES">
-      <MacroExpansion>
-         <BuildableReference
-            BuildableIdentifier = "primary"
-            BlueprintIdentifier = "0EB833451BBF45E600DDC844"
-            BuildableName = "logger"
-            BlueprintName = "logger"
-            ReferencedContainer = "container:logger.xcodeproj">
-         </BuildableReference>
-      </MacroExpansion>
-   </ProfileAction>
-   <AnalyzeAction
-      buildConfiguration = "Debug">
-   </AnalyzeAction>
-   <ArchiveAction
-      buildConfiguration = "Release"
-      revealArchiveInOrganizer = "YES">
-   </ArchiveAction>
-</Scheme>

+ 1 - 1
logger.xcodeproj/xcuserdata/samjaffe.xcuserdatad/xcschemes/logging.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "0720"
+   LastUpgradeVersion = "1000"
    version = "1.3">
    <BuildAction
       parallelizeBuildables = "YES"

+ 5 - 3
logger.xcodeproj/xcuserdata/samjaffe.xcuserdatad/xcschemes/xcschememanagement.plist

@@ -4,15 +4,17 @@
 <dict>
 	<key>SchemeUserState</key>
 	<dict>
-		<key>logger.xcscheme</key>
+		<key>logger_test.xcscheme_^#shared#^_</key>
 		<dict>
 			<key>orderHint</key>
-			<integer>5</integer>
+			<integer>46</integer>
 		</dict>
 		<key>logging.xcscheme</key>
 		<dict>
+			<key>isShown</key>
+			<false/>
 			<key>orderHint</key>
-			<integer>6</integer>
+			<integer>3</integer>
 		</dict>
 	</dict>
 	<key>SuppressBuildableAutocreation</key>

+ 22 - 0
logger_test/Info.plist

@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>$(DEVELOPMENT_LANGUAGE)</string>
+	<key>CFBundleExecutable</key>
+	<string>$(EXECUTABLE_NAME)</string>
+	<key>CFBundleIdentifier</key>
+	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>$(PRODUCT_NAME)</string>
+	<key>CFBundlePackageType</key>
+	<string>BNDL</string>
+	<key>CFBundleShortVersionString</key>
+	<string>1.0</string>
+	<key>CFBundleVersion</key>
+	<string>1</string>
+</dict>
+</plist>

+ 2 - 2
format.cpp

@@ -14,8 +14,8 @@
 #include <stdexcept>
 #include <string>
 
-#include "format.hpp"
-#include "logger.hpp"
+#include "logger/format.hpp"
+#include "logger/logger.hpp"
 
 #if defined( _WIN32 )
 # define NEWLINE "\r\n"

+ 3 - 9
logger.cpp

@@ -14,8 +14,8 @@
 #include <stdexcept>
 
 #include "expect/expect.hpp"
-#include "logger.hpp"
-#include "properties.hpp"
+#include "logger/logger.hpp"
+//#include "properties.hpp"
 
 namespace logging {
 #define X(l) \
@@ -53,7 +53,7 @@ namespace logging {
   };
   
   //  extern logger_impl& _logger_impl_shared_instance();
-  extern _binding _default_logger_impl;
+  extern logger_impl& (*_default_logger_impl)(void);
   static _binding _impl_binding = nullptr;
   
   bool bind_logger_impl(_binding impl) {
@@ -120,9 +120,3 @@ namespace logging {
     return ll < min_log_level;
   }
 }
-
-void test() {
-  logging::logger & LOG = logging::logger::instance( );
-  LOG.log(logging::LERROR, "{}", 5);
-}
-

+ 52 - 0
test/logger_test.cxx

@@ -0,0 +1,52 @@
+//
+//  logger_test.cxx
+//  logger
+//
+//  Created by Sam Jaffe on 3/31/19.
+//
+
+#include <gmock/gmock.h>
+
+#include "logger/logger.hpp"
+
+struct MockLoggerImpl : public logging::logger_impl {
+  MOCK_METHOD0(flush, void());
+  MOCK_METHOD1(write, void(logging::logpacket const &));
+};
+
+struct LoggerTest : public testing::Test {
+  static void SetUpTestCase();
+  static void TearDownTestCase();
+  void SetUp() override;
+  void TearDown() override;
+
+  static std::unique_ptr<MockLoggerImpl> pimpl;
+};
+std::unique_ptr<MockLoggerImpl> LoggerTest::pimpl{};
+
+using namespace logging;
+void LoggerTest::SetUpTestCase() {
+  _binding bind([]() -> logger_impl& {
+    return *pimpl;
+  });
+  bind_logger_impl(bind);
+}
+
+void LoggerTest::SetUp() {
+  pimpl.reset(new MockLoggerImpl);
+}
+
+void LoggerTest::TearDown() {
+  pimpl.reset();
+}
+
+TEST_F(LoggerTest, ImplCannotBeMadeTwice) {
+  EXPECT_ANY_THROW(bind_logger_impl(nullptr));
+}
+
+TEST_F(LoggerTest, LogsWithBraceFmtCode) {
+  using testing::Field;
+  EXPECT_CALL(*pimpl, write(Field(&logpacket::message, "5"))).Times(1);
+  logger & LOG = logger::instance( );
+  LOG.log(LERROR, "{}", 5);
+}