diff --git a/Example/Logsene.xcodeproj/project.pbxproj b/Example/Logsene.xcodeproj/project.pbxproj index 9103290..bc38766 100644 --- a/Example/Logsene.xcodeproj/project.pbxproj +++ b/Example/Logsene.xcodeproj/project.pbxproj @@ -15,7 +15,7 @@ 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; - DC404DB57F3176A0C3184227 /* Pods_Logsene_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CE9145C832184A63B354EC5C /* Pods_Logsene_Tests.framework */; }; + DDC2E63426FC7816D52AE606 /* Pods_Logsene_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A2196FBCFADB0A5475B8FBAE /* Pods_Logsene_Tests.framework */; }; EE4DF9BB71B2BA01E774FA8C /* Pods_Logsene_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0BBAB8007A53A990DA01031E /* Pods_Logsene_Example.framework */; }; /* End PBXBuildFile section */ @@ -34,7 +34,6 @@ 115B97F770A95591FBBE76A3 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 1CBD0BA024549F14005016C7 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = ""; }; 1CBD0BA224549FA9005016C7 /* TestActionsController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TestActionsController.swift; sourceTree = ""; }; - 2CC997AC234EA35933B87FD1 /* Pods-Logsene_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Logsene_Tests.debug.xcconfig"; path = "Target Support Files/Pods-Logsene_Tests/Pods-Logsene_Tests.debug.xcconfig"; sourceTree = ""; }; 607FACD01AFB9204008FA782 /* Logsene_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Logsene_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; @@ -45,11 +44,12 @@ 607FACE51AFB9204008FA782 /* Logsene_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Logsene_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; + 88F9F7A5D40655CCBB7006DD /* Pods-Logsene_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Logsene_Tests.debug.xcconfig"; path = "Target Support Files/Pods-Logsene_Tests/Pods-Logsene_Tests.debug.xcconfig"; sourceTree = ""; }; 9C720C4242C71A8C6F6B68BB /* Logsene.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = Logsene.podspec; path = ../Logsene.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; - CE9145C832184A63B354EC5C /* Pods_Logsene_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Logsene_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + A2196FBCFADB0A5475B8FBAE /* Pods_Logsene_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Logsene_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + BF493A750CFBFFB060312FF1 /* Pods-Logsene_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Logsene_Tests.release.xcconfig"; path = "Target Support Files/Pods-Logsene_Tests/Pods-Logsene_Tests.release.xcconfig"; sourceTree = ""; }; CEB77BF41D0B6019CF989DAD /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; E009C445593066D7119D5B0F /* Pods-Logsene_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Logsene_Example.release.xcconfig"; path = "Target Support Files/Pods-Logsene_Example/Pods-Logsene_Example.release.xcconfig"; sourceTree = ""; }; - E928E12D475C7124EFD6031D /* Pods-Logsene_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Logsene_Tests.release.xcconfig"; path = "Target Support Files/Pods-Logsene_Tests/Pods-Logsene_Tests.release.xcconfig"; sourceTree = ""; }; EB7F33A292BC01C0C5420F28 /* Pods-Logsene_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Logsene_Example.debug.xcconfig"; path = "Target Support Files/Pods-Logsene_Example/Pods-Logsene_Example.debug.xcconfig"; sourceTree = ""; }; /* End PBXFileReference section */ @@ -66,7 +66,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - DC404DB57F3176A0C3184227 /* Pods_Logsene_Tests.framework in Frameworks */, + DDC2E63426FC7816D52AE606 /* Pods_Logsene_Tests.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -77,7 +77,7 @@ isa = PBXGroup; children = ( 0BBAB8007A53A990DA01031E /* Pods_Logsene_Example.framework */, - CE9145C832184A63B354EC5C /* Pods_Logsene_Tests.framework */, + A2196FBCFADB0A5475B8FBAE /* Pods_Logsene_Tests.framework */, ); name = Frameworks; sourceTree = ""; @@ -159,8 +159,8 @@ children = ( EB7F33A292BC01C0C5420F28 /* Pods-Logsene_Example.debug.xcconfig */, E009C445593066D7119D5B0F /* Pods-Logsene_Example.release.xcconfig */, - 2CC997AC234EA35933B87FD1 /* Pods-Logsene_Tests.debug.xcconfig */, - E928E12D475C7124EFD6031D /* Pods-Logsene_Tests.release.xcconfig */, + 88F9F7A5D40655CCBB7006DD /* Pods-Logsene_Tests.debug.xcconfig */, + BF493A750CFBFFB060312FF1 /* Pods-Logsene_Tests.release.xcconfig */, ); path = Pods; sourceTree = ""; @@ -191,11 +191,10 @@ isa = PBXNativeTarget; buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "Logsene_Tests" */; buildPhases = ( - AA71EC6420585D08C9E23C2B /* [CP] Check Pods Manifest.lock */, + 76463F69F7DF5A38A2EE2A5B /* [CP] Check Pods Manifest.lock */, 607FACE11AFB9204008FA782 /* Sources */, 607FACE21AFB9204008FA782 /* Frameworks */, 607FACE31AFB9204008FA782 /* Resources */, - E93DEE48770A720AF21C9494 /* [CP] Embed Pods Frameworks */, ); buildRules = ( ); @@ -268,7 +267,7 @@ /* End PBXResourcesBuildPhase section */ /* Begin PBXShellScriptBuildPhase section */ - A24530DED69C5F5BCDC01B51 /* [CP] Check Pods Manifest.lock */ = { + 76463F69F7DF5A38A2EE2A5B /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -283,14 +282,14 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Logsene_Example-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Logsene_Tests-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - AA71EC6420585D08C9E23C2B /* [CP] Check Pods Manifest.lock */ = { + A24530DED69C5F5BCDC01B51 /* [CP] Check Pods Manifest.lock */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; files = ( @@ -305,33 +304,13 @@ outputFileListPaths = ( ); outputPaths = ( - "$(DERIVED_FILE_DIR)/Pods-Logsene_Tests-checkManifestLockResult.txt", + "$(DERIVED_FILE_DIR)/Pods-Logsene_Example-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; - E93DEE48770A720AF21C9494 /* [CP] Embed Pods Frameworks */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - "${PODS_ROOT}/Target Support Files/Pods-Logsene_Tests/Pods-Logsene_Tests-frameworks.sh", - "${BUILT_PRODUCTS_DIR}/Nimble/Nimble.framework", - "${BUILT_PRODUCTS_DIR}/Quick/Quick.framework", - ); - name = "[CP] Embed Pods Frameworks"; - outputPaths = ( - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Nimble.framework", - "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Quick.framework", - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-Logsene_Tests/Pods-Logsene_Tests-frameworks.sh\"\n"; - showEnvVarsInLog = 0; - }; F9B81E928F231E62A08F9170 /* [CP] Embed Pods Frameworks */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 2147483647; @@ -549,7 +528,7 @@ }; 607FACF31AFB9204008FA782 /* Debug */ = { isa = XCBuildConfiguration; - baseConfigurationReference = 2CC997AC234EA35933B87FD1 /* Pods-Logsene_Tests.debug.xcconfig */; + baseConfigurationReference = 88F9F7A5D40655CCBB7006DD /* Pods-Logsene_Tests.debug.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", @@ -571,7 +550,7 @@ }; 607FACF41AFB9204008FA782 /* Release */ = { isa = XCBuildConfiguration; - baseConfigurationReference = E928E12D475C7124EFD6031D /* Pods-Logsene_Tests.release.xcconfig */; + baseConfigurationReference = BF493A750CFBFFB060312FF1 /* Pods-Logsene_Tests.release.xcconfig */; buildSettings = { FRAMEWORK_SEARCH_PATHS = ( "$(PLATFORM_DIR)/Developer/Library/Frameworks", diff --git a/Example/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Example.xcscheme b/Example/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Example.xcscheme index 076d7fe..3679730 100644 --- a/Example/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Example.xcscheme +++ b/Example/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Example.xcscheme @@ -1,6 +1,6 @@ 3.0' - pod 'Nimble', '~> 9.0' end end diff --git a/Example/Podfile.lock b/Example/Podfile.lock index 77063a0..e818034 100644 --- a/Example/Podfile.lock +++ b/Example/Podfile.lock @@ -2,22 +2,15 @@ PODS: - CocoaLumberjack/Core (3.6.1) - CocoaLumberjack/Swift (3.6.1): - CocoaLumberjack/Core - - Logsene (1.6.0) - - Nimble (9.0.0) - - Quick (3.0.0) + - Logsene (1.6.1) DEPENDENCIES: - CocoaLumberjack/Swift - Logsene (from `../`) - - Nimble (~> 9.0) - - Quick (~> 3.0) SPEC REPOS: https://github.com/CocoaPods/Specs.git: - CocoaLumberjack - trunk: - - Nimble - - Quick EXTERNAL SOURCES: Logsene: @@ -26,10 +19,8 @@ EXTERNAL SOURCES: SPEC CHECKSUMS: CocoaLumberjack: b17ae15142558d08bbacf69775fa10c4abbebcc9 - Logsene: e537b4158aff29cabd9be050aabda5d7d35f0cc1 - Nimble: 3b4ec3fd40f1dc178058e0981107721c615643d8 - Quick: 6d9559f40647bc4d510103842ef2fdd882d753e2 + Logsene: afed1d1d48881f9c5d8261e75caf74d806ffc1b4 -PODFILE CHECKSUM: 24ea5f0942d1fdc3553f9c0e04fa216ae7938808 +PODFILE CHECKSUM: 6216c40be1df587984d8c9469884a257bbac56af COCOAPODS: 1.9.3 diff --git a/Example/Tests/Tests.swift b/Example/Tests/Tests.swift index c77f68e..8a263e7 100644 --- a/Example/Tests/Tests.swift +++ b/Example/Tests/Tests.swift @@ -1,10 +1,22 @@ -// https://github.com/Quick/Quick - -import Quick -import Nimble import Logsene +import XCTest -class TableOfContentsSpec: QuickSpec { - override func spec() { +class LogseneTests: XCTestCase { + override func setUp() { + super.setUp() + } + + override func tearDown() { + super.tearDown() + } + + func testExample() { + XCTAssertTrue(true) + } + + func testLogsene() { + try! LogseneInit("du72esds-s21s-xws2-2sww-sas1dwsa12sa", type: "example") + LLogInfo("Sample message") + XCTAssertTrue(true) } } diff --git a/Logsene.podspec b/Logsene.podspec index b6a7ae8..ff0c69e 100644 --- a/Logsene.podspec +++ b/Logsene.podspec @@ -8,7 +8,7 @@ Pod::Spec.new do |s| s.name = 'Logsene' - s.version = '1.6.0' + s.version = '1.6.1' s.summary = 'Sematext Cloud Logs is ELK as a Service. This library lets you collect mobile analytics and log data from your iOS applications.' s.description = <<-DESC @@ -25,6 +25,8 @@ Pod::Spec.new do |s| s.ios.deployment_target = '12.0' s.osx.deployment_target = '10.10' + s.tvos.deployment_target = '12.0' + s.watchos.deployment_target = '5.0' s.source_files = 'Logsene/Classes/**/*' s.swift_versions = ['4.0', '4.1', '4.2', '5.0', '5.1', '5.2'] diff --git a/Logsene.xcodeproj/Example_Info.plist b/Logsene.xcodeproj/Example_Info.plist new file mode 100644 index 0000000..7c23420 --- /dev/null +++ b/Logsene.xcodeproj/Example_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Logsene.xcodeproj/Logsene_Info.plist b/Logsene.xcodeproj/Logsene_Info.plist new file mode 100644 index 0000000..57ada9f --- /dev/null +++ b/Logsene.xcodeproj/Logsene_Info.plist @@ -0,0 +1,25 @@ + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/Logsene.xcodeproj/project.pbxproj b/Logsene.xcodeproj/project.pbxproj new file mode 100644 index 0000000..e98e7fc --- /dev/null +++ b/Logsene.xcodeproj/project.pbxproj @@ -0,0 +1,693 @@ +// !$*UTF8*$! +{ + archiveVersion = "1"; + objectVersion = "46"; + objects = { + "Logsene::Example" = { + isa = "PBXNativeTarget"; + buildConfigurationList = "OBJ_35"; + buildPhases = ( + "OBJ_38", + "OBJ_43" + ); + dependencies = ( + "OBJ_45" + ); + name = "Example"; + productName = "Example"; + productReference = "Logsene::Example::Product"; + productType = "com.apple.product-type.bundle.unit-test"; + }; + "Logsene::Example::Product" = { + isa = "PBXFileReference"; + path = "Example.xctest"; + sourceTree = "BUILT_PRODUCTS_DIR"; + }; + "Logsene::Logsene" = { + isa = "PBXNativeTarget"; + buildConfigurationList = "OBJ_47"; + buildPhases = ( + "OBJ_50", + "OBJ_60" + ); + dependencies = ( + ); + name = "Logsene"; + productName = "Logsene"; + productReference = "Logsene::Logsene::Product"; + productType = "com.apple.product-type.framework"; + }; + "Logsene::Logsene::Product" = { + isa = "PBXFileReference"; + path = "Logsene.framework"; + sourceTree = "BUILT_PRODUCTS_DIR"; + }; + "Logsene::LogsenePackageTests::ProductTarget" = { + isa = "PBXAggregateTarget"; + buildConfigurationList = "OBJ_68"; + buildPhases = ( + ); + dependencies = ( + "OBJ_71" + ); + name = "LogsenePackageTests"; + productName = "LogsenePackageTests"; + }; + "Logsene::SwiftPMPackageDescription" = { + isa = "PBXNativeTarget"; + buildConfigurationList = "OBJ_62"; + buildPhases = ( + "OBJ_65" + ); + dependencies = ( + ); + name = "LogsenePackageDescription"; + productName = "LogsenePackageDescription"; + productType = "com.apple.product-type.framework"; + }; + "OBJ_1" = { + isa = "PBXProject"; + attributes = { + LastSwiftMigration = "9999"; + LastUpgradeCheck = "9999"; + }; + buildConfigurationList = "OBJ_2"; + compatibilityVersion = "Xcode 3.2"; + developmentRegion = "en"; + hasScannedForEncodings = "0"; + knownRegions = ( + "en" + ); + mainGroup = "OBJ_5"; + productRefGroup = "OBJ_23"; + projectDirPath = "."; + targets = ( + "Logsene::Example", + "Logsene::Logsene", + "Logsene::SwiftPMPackageDescription", + "Logsene::LogsenePackageTests::ProductTarget" + ); + }; + "OBJ_10" = { + isa = "PBXFileReference"; + path = "LReachability.swift"; + sourceTree = ""; + }; + "OBJ_11" = { + isa = "PBXFileReference"; + path = "LogsEventObjectBuffer.swift"; + sourceTree = ""; + }; + "OBJ_12" = { + isa = "PBXFileReference"; + path = "LogseneClient.swift"; + sourceTree = ""; + }; + "OBJ_13" = { + isa = "PBXFileReference"; + path = "NSDate.swift"; + sourceTree = ""; + }; + "OBJ_14" = { + isa = "PBXFileReference"; + path = "SQLiteDB.swift"; + sourceTree = ""; + }; + "OBJ_15" = { + isa = "PBXFileReference"; + path = "String.swift"; + sourceTree = ""; + }; + "OBJ_16" = { + isa = "PBXFileReference"; + path = "Worker.swift"; + sourceTree = ""; + }; + "OBJ_17" = { + isa = "PBXGroup"; + children = ( + "OBJ_18", + "OBJ_19", + "OBJ_20", + "OBJ_21", + "OBJ_22" + ); + name = "Tests"; + path = "Example/Logsene"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_18" = { + isa = "PBXFileReference"; + path = "Info.plist"; + sourceTree = ""; + }; + "OBJ_19" = { + isa = "PBXFileReference"; + path = "AppDelegate.swift"; + sourceTree = ""; + }; + "OBJ_2" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_3", + "OBJ_4" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_20" = { + isa = "PBXFileReference"; + path = "Logger.swift"; + sourceTree = ""; + }; + "OBJ_21" = { + isa = "PBXFileReference"; + path = "TestActionsController.swift"; + sourceTree = ""; + }; + "OBJ_22" = { + isa = "PBXFileReference"; + path = "ViewController.swift"; + sourceTree = ""; + }; + "OBJ_23" = { + isa = "PBXGroup"; + children = ( + "Logsene::Logsene::Product", + "Logsene::Example::Product" + ); + name = "Products"; + path = ""; + sourceTree = "BUILT_PRODUCTS_DIR"; + }; + "OBJ_26" = { + isa = "PBXFileReference"; + path = "images"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_27" = { + isa = "PBXFileReference"; + path = "Example"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_28" = { + isa = "PBXFileReference"; + path = "Logsene"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_29" = { + isa = "PBXFileReference"; + path = "xcuserdata"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_3" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = "YES"; + COMBINE_HIDPI_IMAGES = "YES"; + COPY_PHASE_STRIP = "NO"; + DEBUG_INFORMATION_FORMAT = "dwarf"; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = "YES"; + GCC_OPTIMIZATION_LEVEL = "0"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE=1", + "DEBUG=1" + ); + MACOSX_DEPLOYMENT_TARGET = "10.10"; + ONLY_ACTIVE_ARCH = "YES"; + OTHER_SWIFT_FLAGS = ( + "$(inherited)", + "-DXcode" + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = "macosx"; + SUPPORTED_PLATFORMS = ( + "macosx", + "iphoneos", + "iphonesimulator", + "appletvos", + "appletvsimulator", + "watchos", + "watchsimulator" + ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE", + "DEBUG" + ); + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + USE_HEADERMAP = "NO"; + }; + name = "Debug"; + }; + "OBJ_30" = { + isa = "PBXFileReference"; + path = "LICENSE.md"; + sourceTree = ""; + }; + "OBJ_31" = { + isa = "PBXFileReference"; + path = "Logsene.podspec"; + sourceTree = ""; + }; + "OBJ_32" = { + isa = "PBXFileReference"; + path = "project.pbxproj"; + sourceTree = ""; + }; + "OBJ_33" = { + isa = "PBXFileReference"; + path = "README.md"; + sourceTree = ""; + }; + "OBJ_35" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_36", + "OBJ_37" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_36" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_MODULES = "YES"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "Logsene.xcodeproj/Example_Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@loader_path/../Frameworks", + "@loader_path/Frameworks" + ); + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "4.0"; + TARGET_NAME = "Example"; + }; + name = "Debug"; + }; + "OBJ_37" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_MODULES = "YES"; + EMBEDDED_CONTENT_CONTAINS_SWIFT = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "Logsene.xcodeproj/Example_Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@loader_path/../Frameworks", + "@loader_path/Frameworks" + ); + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "4.0"; + TARGET_NAME = "Example"; + }; + name = "Release"; + }; + "OBJ_38" = { + isa = "PBXSourcesBuildPhase"; + files = ( + "OBJ_39", + "OBJ_40", + "OBJ_41", + "OBJ_42" + ); + }; + "OBJ_39" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_19"; + }; + "OBJ_4" = { + isa = "XCBuildConfiguration"; + buildSettings = { + CLANG_ENABLE_OBJC_ARC = "YES"; + COMBINE_HIDPI_IMAGES = "YES"; + COPY_PHASE_STRIP = "YES"; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + GCC_OPTIMIZATION_LEVEL = "s"; + GCC_PREPROCESSOR_DEFINITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE=1" + ); + MACOSX_DEPLOYMENT_TARGET = "10.10"; + OTHER_SWIFT_FLAGS = ( + "$(inherited)", + "-DXcode" + ); + PRODUCT_NAME = "$(TARGET_NAME)"; + SDKROOT = "macosx"; + SUPPORTED_PLATFORMS = ( + "macosx", + "iphoneos", + "iphonesimulator", + "appletvos", + "appletvsimulator", + "watchos", + "watchsimulator" + ); + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)", + "SWIFT_PACKAGE" + ); + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + USE_HEADERMAP = "NO"; + }; + name = "Release"; + }; + "OBJ_40" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_20"; + }; + "OBJ_41" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_21"; + }; + "OBJ_42" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_22"; + }; + "OBJ_43" = { + isa = "PBXFrameworksBuildPhase"; + files = ( + "OBJ_44" + ); + }; + "OBJ_44" = { + isa = "PBXBuildFile"; + fileRef = "Logsene::Logsene::Product"; + }; + "OBJ_45" = { + isa = "PBXTargetDependency"; + target = "Logsene::Logsene"; + }; + "OBJ_47" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_48", + "OBJ_49" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_48" = { + isa = "XCBuildConfiguration"; + buildSettings = { + ENABLE_TESTABILITY = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "Logsene.xcodeproj/Logsene_Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" + ); + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + PRODUCT_BUNDLE_IDENTIFIER = "Logsene"; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = "YES"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "4.0"; + TARGET_NAME = "Logsene"; + }; + name = "Debug"; + }; + "OBJ_49" = { + isa = "XCBuildConfiguration"; + buildSettings = { + ENABLE_TESTABILITY = "YES"; + FRAMEWORK_SEARCH_PATHS = ( + "$(inherited)", + "$(PLATFORM_DIR)/Developer/Library/Frameworks" + ); + HEADER_SEARCH_PATHS = ( + "$(inherited)" + ); + INFOPLIST_FILE = "Logsene.xcodeproj/Logsene_Info.plist"; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "$(TOOLCHAIN_DIR)/usr/lib/swift/macosx" + ); + OTHER_CFLAGS = ( + "$(inherited)" + ); + OTHER_LDFLAGS = ( + "$(inherited)" + ); + OTHER_SWIFT_FLAGS = ( + "$(inherited)" + ); + PRODUCT_BUNDLE_IDENTIFIER = "Logsene"; + PRODUCT_MODULE_NAME = "$(TARGET_NAME:c99extidentifier)"; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = "YES"; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = ( + "$(inherited)" + ); + SWIFT_VERSION = "4.0"; + TARGET_NAME = "Logsene"; + }; + name = "Release"; + }; + "OBJ_5" = { + isa = "PBXGroup"; + children = ( + "OBJ_6", + "OBJ_7", + "OBJ_17", + "OBJ_23", + "OBJ_26", + "OBJ_27", + "OBJ_28", + "OBJ_29", + "OBJ_30", + "OBJ_31", + "OBJ_32", + "OBJ_33" + ); + path = ""; + sourceTree = ""; + }; + "OBJ_50" = { + isa = "PBXSourcesBuildPhase"; + files = ( + "OBJ_51", + "OBJ_52", + "OBJ_53", + "OBJ_54", + "OBJ_55", + "OBJ_56", + "OBJ_57", + "OBJ_58", + "OBJ_59" + ); + }; + "OBJ_51" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_8"; + }; + "OBJ_52" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_9"; + }; + "OBJ_53" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_10"; + }; + "OBJ_54" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_11"; + }; + "OBJ_55" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_12"; + }; + "OBJ_56" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_13"; + }; + "OBJ_57" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_14"; + }; + "OBJ_58" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_15"; + }; + "OBJ_59" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_16"; + }; + "OBJ_6" = { + isa = "PBXFileReference"; + explicitFileType = "sourcecode.swift"; + path = "Package.swift"; + sourceTree = ""; + }; + "OBJ_60" = { + isa = "PBXFrameworksBuildPhase"; + files = ( + ); + }; + "OBJ_62" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_63", + "OBJ_64" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_63" = { + isa = "XCBuildConfiguration"; + buildSettings = { + LD = "/usr/bin/true"; + OTHER_SWIFT_FLAGS = ( + "-swift-version", + "4", + "-I", + "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4", + "-sdk", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk", + "-package-description-version", + "4.0.0" + ); + SWIFT_VERSION = "4.0"; + }; + name = "Debug"; + }; + "OBJ_64" = { + isa = "XCBuildConfiguration"; + buildSettings = { + LD = "/usr/bin/true"; + OTHER_SWIFT_FLAGS = ( + "-swift-version", + "4", + "-I", + "$(TOOLCHAIN_DIR)/usr/lib/swift/pm/4", + "-sdk", + "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk", + "-package-description-version", + "4.0.0" + ); + SWIFT_VERSION = "4.0"; + }; + name = "Release"; + }; + "OBJ_65" = { + isa = "PBXSourcesBuildPhase"; + files = ( + "OBJ_66" + ); + }; + "OBJ_66" = { + isa = "PBXBuildFile"; + fileRef = "OBJ_6"; + }; + "OBJ_68" = { + isa = "XCConfigurationList"; + buildConfigurations = ( + "OBJ_69", + "OBJ_70" + ); + defaultConfigurationIsVisible = "0"; + defaultConfigurationName = "Release"; + }; + "OBJ_69" = { + isa = "XCBuildConfiguration"; + buildSettings = { + }; + name = "Debug"; + }; + "OBJ_7" = { + isa = "PBXGroup"; + children = ( + "OBJ_8", + "OBJ_9", + "OBJ_10", + "OBJ_11", + "OBJ_12", + "OBJ_13", + "OBJ_14", + "OBJ_15", + "OBJ_16" + ); + name = "Sources"; + path = "Logsene/Classes"; + sourceTree = "SOURCE_ROOT"; + }; + "OBJ_70" = { + isa = "XCBuildConfiguration"; + buildSettings = { + }; + name = "Release"; + }; + "OBJ_71" = { + isa = "PBXTargetDependency"; + target = "Logsene::Example"; + }; + "OBJ_8" = { + isa = "PBXFileReference"; + path = "Core.swift"; + sourceTree = ""; + }; + "OBJ_9" = { + isa = "PBXFileReference"; + path = "DispatchQueue+Once.swift"; + sourceTree = ""; + }; + }; + rootObject = "OBJ_1"; +} diff --git a/Logsene.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Logsene.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..fe1aa71 --- /dev/null +++ b/Logsene.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/Logsene.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/Logsene.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings new file mode 100644 index 0000000..a72dc2b --- /dev/null +++ b/Logsene.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings @@ -0,0 +1,8 @@ + + + + + IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded + + + \ No newline at end of file diff --git a/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Package.xcscheme b/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Package.xcscheme new file mode 100644 index 0000000..326e4e5 --- /dev/null +++ b/Logsene.xcodeproj/xcshareddata/xcschemes/Logsene-Package.xcscheme @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + diff --git a/Logsene/Classes/Core.swift b/Logsene/Classes/Core.swift index a6d6dde..b1b3a13 100644 --- a/Logsene/Classes/Core.swift +++ b/Logsene/Classes/Core.swift @@ -207,6 +207,11 @@ private func enrichEvent(_ event: inout JsonObject) { meta["osRelease"] = "\(os.majorVersion).\(os.minorVersion).\(os.patchVersion)" #if os(macOS) meta["osType"] = "MacOS" + #elseif os(watchOS) + meta["osType"] = "watchOS" + #elseif os(tvOS) + meta["osType"] = "tvOS" + meta["uuid"] = UIDevice.current.identifierForVendor!.uuidString #else meta["osType"] = "iOS" meta["uuid"] = UIDevice.current.identifierForVendor!.uuidString diff --git a/Logsene/Classes/LReachability.swift b/Logsene/Classes/LReachability.swift index 6151ebe..8c18d10 100644 --- a/Logsene/Classes/LReachability.swift +++ b/Logsene/Classes/LReachability.swift @@ -21,6 +21,8 @@ POSSIBILITY OF SUCH DAMAGE. */ +#if os(watchOS) +#else import SystemConfiguration import Foundation @@ -292,3 +294,4 @@ fileprivate extension Reachability { } } } +#endif diff --git a/Logsene/Classes/Worker.swift b/Logsene/Classes/Worker.swift index e4076a3..254907e 100644 --- a/Logsene/Classes/Worker.swift +++ b/Logsene/Classes/Worker.swift @@ -20,15 +20,23 @@ class Worker: NSObject { fileprivate var timer: DispatchSourceTimer fileprivate let client: LogseneClient fileprivate let type: String + #if os(watchOS) + #else fileprivate let reach: Reachability + #endif fileprivate var isOnline: Bool = true fileprivate var isActive: Bool = true + #if os(iOS) fileprivate var locationManager: CLLocationManager? = nil + #endif init(client: LogseneClient, type: String, maxOfflineMessages: Int, automaticLocationEnriching: Bool, useLocationOnlyInForeground: Bool) throws { serialQueue = DispatchQueue(label: "logworker_events", attributes: []) + #if os(watchOS) + #else reach = Reachability()! - + #endif + // Setup buffer for storing messages before sending them to Logsene // This also acts as the offline buffer if device is not online let path = NSSearchPathForDirectoriesInDomains(.documentDirectory, .userDomainMask, true).first! @@ -45,8 +53,7 @@ class Worker: NSObject { super.init() // setup location manager if needed - this should be done only for iOS - #if os(macOS) - #else + #if os(iOS) if automaticLocationEnriching { self.locationManager = CLLocationManager() self.locationManager?.delegate = self @@ -71,6 +78,9 @@ class Worker: NSObject { timer.resume() // Setup Reachability to notify when device is online/offline + // Except for watchOS + #if os(watchOS) + #else reach.whenReachable = { (reach) in self.serialQueue.async { self.isOnline = true @@ -83,6 +93,7 @@ class Worker: NSObject { } try reach.startNotifier() + #endif } func addToQueue(_ event: JsonObject) { @@ -178,20 +189,16 @@ class Worker: NSObject { } } +#if os(iOS) extension Worker: CLLocationManagerDelegate { - #if os(macOS) - #else func locationManager(_ manager: CLLocationManager, didVisit visit: CLVisit) { NSLog("Setting location to %d %d", Double(visit.coordinate.latitude), Double(visit.coordinate.longitude)) self.locationSet = true self.currentLatitude = Double(visit.coordinate.latitude) self.currentLongitude = Double(visit.coordinate.longitude) } - #endif func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { - #if os(macOS) - #else if locations.first != nil { self.currentLatitude = locations.first?.coordinate.latitude self.currentLongitude = locations.first?.coordinate.longitude @@ -199,7 +206,6 @@ extension Worker: CLLocationManagerDelegate { self.locationSet = true } } - #endif } func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) { @@ -207,12 +213,10 @@ extension Worker: CLLocationManagerDelegate { } func readInitialLocation() { - #if os(macOS) - #else NSLog("Reading initial location") if #available(iOS 9.0, *) { self.locationManager?.requestLocation() } - #endif } } +#endif