cpp_client_telemetry/wrappers/swift/Sources/OneDSSwift/Logger.swift

238 строки
11 KiB
Swift
Исходник Постоянная ссылка Обычный вид История

//
// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
//
import ObjCModule
/// Wrapper class around ObjC Logger class `ODWLogger` used to events.
public final class Logger {
private var odwLogger: ODWLogger
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
private(set) var _semanticContext: SemanticContext
/// Semantic context for the logger.
public var semanticContext:SemanticContext {
get {
_semanticContext
}
}
/// Constructs `Logger` with `ODWLogger` object which would be wrapped around.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
init(logger: ODWLogger) {
odwLogger = logger
_semanticContext = SemanticContext(odwSemanticContext: odwLogger.semanticContext)
}
// MARK: Basic LogEvent methods
/**
Logs a custom event with a specified name.
- Parameters:
- name: A `String` that contains the name of the event.
*/
public func logEvent(name: String) {
odwLogger.logEvent(withName: name)
}
/**
Logs a custom event with a specified set of properties.
- Parameters:
- eventProperties: The custome event properties, as `EventProperties`.
*/
public func logEvent(properties: EventProperties) {
odwLogger.logEvent(with: properties.getODWEventPropertiesObject())
}
// MARK: Semantic LogEvent methods
/**
Logs a failure event (such as an app exception), taking a signature, failure details, and event properties.
- Parameters:
- signature: A `String` that identifies the bucket of the failure.
- eventDetail: A `String` that contains a description of the failure.
- eventProperties: Properties of the failure event, encapsulated within an `EventProperties`.
*/
public func logFailureWithSignature(_ signature: String, eventDetail detail: String, eventProperties properties: EventProperties) {
odwLogger.logFailure(withSignature: signature, detail: detail, eventproperties: properties.getODWEventPropertiesObject())
}
/**
Logs a failure with event (such as an app exception) with all the details.
- Parameters:
- signature: A `String` that identifies the bucket of the failure.
- eventDetail: A `String` that contains a description of the failure.
- eventCategory: A `String` that represents category of the event.
- eventID: Event ID as a `String`
- eventProperties: Properties of the failure event, encapsulated within an `EventProperties`.
*/
public func logFailureWithSignature(_ signature: String,
eventDetail detail: String,
eventCategory category: String,
eventID id: String,
eventProperties properties: EventProperties) {
odwLogger.logFailure(withSignature: signature, detail: detail, category: category, id: id, eventProperties: properties.getODWEventPropertiesObject())
}
/**
Logs a page action event.
- Parameters:
- identifier: `String` that contains unquely identifiable page view.
- pageName: Page name as a `String`.
- eventProperties: Properties of the failure event, encapsulated within an `EventProperties`.
*/
public func logPageViewWithID(_ identifier: String, pageName: String, eventProperties properties: EventProperties) {
odwLogger.logPageView(withId: identifier, pageName: pageName, eventProperties: properties.getODWEventPropertiesObject())
}
/**
Logs a page action event.
- Parameters:
- identifier: `String` that contains unquely identifiable page view.
- pageName: Page name as a `String`.
- eventCategory: A `String` that contains name of the category this event belongs to.
- uri: `String` that contains "URI" of this page.
- referrerURI: `String` that contains "URI" that refers to this page.
- eventProperties: Properties of the failure event, encapsulated within an `EventProperties`.
*/
public func logPageViewWithID(_ identifier: String,
pageName: String,
eventCategory category: String,
uri: String,
referrerURI: String,
eventProperties properties: EventProperties) {
odwLogger.logPageView(withId: identifier, pageName: pageName, category: category, uri: uri, referrerUri: referrerURI, eventProperties: properties.getODWEventPropertiesObject())
}
/**
Logs a diagnostic trace event to help you troubleshoot problems.
- Parameters:
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- traceLevel: Level of trace as one of `TraceLevel` enum values.
- traceMessage: `String` that contains description of the trace.
- eventProperties: Properties of the failure event, encapsulated within an `EventProperties`.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func logTraceWithTraceLevel(_ traceLevel: TraceLevel, traceMessage message: String, eventProperties properties: EventProperties) {
odwLogger.logTrace(with: traceLevel, message: message, eventProperties: properties.getODWEventPropertiesObject())
}
/**
Logs the session state.
- Note: Logging *session start* while a session is already exists produces a no-op.
Similarly, logging *session end* while a session doesn't exist produces a no-op.
- Parameters:
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- state: The session's state as one of the `SessionState` enum values.
- eventProperties: Properties of the failure event, encapsulated within an `EventProperties`.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func logSessionWithState(_ state: SessionState, eventProperties properties: EventProperties) {
odwLogger.logSession(with: state, eventProperties: properties.getODWEventPropertiesObject())
}
/**
Initializes and gets an instance of Privacy Guard.
*/
public func apply(config initConfigObject: PrivacyGuardInitConfig) {
odwLogger.initializePrivacyGuard(with: initConfigObject.getODWPrivacyGuardInitConfig())
}
// MARK: Set Context methods
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withStringValue: A `String` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withStringValue value: String, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, stringValue: value, piiKind: piiKind)
}
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withBoolValue: A `Bool` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withBoolValue value: Bool, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, boolValue: value, piiKind: piiKind)
}
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withDateValue: A `Date` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withDateValue value: Date, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, dateValue: value, piiKind: piiKind)
}
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withDoubleValue: A `Double` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withDoubleValue value: Double, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, doubleValue: value, piiKind: piiKind)
}
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withInt64Value: A `Int64` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withInt64Value value: Int64, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, int64Value: value, piiKind: piiKind)
}
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withInt32Value: A `Int32` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withInt32Value value: Int32, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, int32Value: value, piiKind: piiKind)
}
/**
Adds (or overrides) a property of context for the telemetry logging system.
Context information applies to event generated by the CPP Logger instance, unless it is overwritten on a particular event property.
- Parameters:
- name: A `String` that contains the name of the property.
- withUUIDValue: A `UUID` that contains the property of the value.
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
- withPiiKind: The kind of "Personal Identifiable Information (PII)", as one of the `PIIKind` enum values.
*/
Hiding all ObjC types behind Swift wrappers (#1176) * adding swift wrapper * moving files to sources * moving files to proper places * adding module for header expose and importing it in swift wrapper * correcting files for build errors and other changes * adding module for objc * swift build passing' * adding readme * changing the package name to 1dsswiftwrapper * changing target name * adding pr suggestions * adding build.sh changes * cmake list file changes * creating static lib * adding swift wrappers build and linking * adding more logic for building and producing sample app * adding code for swiftc invoking * adding comments * adding change to create the sample app * linking and includding modules in swiftc to build the sample exe: being created * adding comments * compiling all files frrom sample * removing extraline * correcting the output folder of swift build * correcting build output folder paths * adding typealias file to stop importing the objcmodule in clients (#1171) * adding typealias file to stop importing the objcmodule in clients * giving better names * adding call to create logger * adding changes for framework include * adding fwks * linking libs and fwks * adding getter and setters for swift as computed properties * adding sample app changes * adding app changes * adding commondatacontext * swift build passing * correcting common context init * adding get set in event properties list * adding getter to eventprops * removing useless methods * adding getter and setter for eventprops * adding getter * fixing type bug * fixing main app issues * adding semantic context variable to the logger * modifying the access level for the objc types in swift to make sure they are not exposed to the lcient * adding default constructor * keeping main.swift clean ' * correcting comment * adding computed property for objc variable --------- Co-authored-by: Lalit Kumar Bhasin <labhas@microsoft.com>
2023-06-24 01:40:02 +03:00
public func setContextWithName(_ name: String, withUUIDValue value: UUID, withPiiKind piiKind: PIIKind = PIIKind.none) {
odwLogger.setContextWithName(name, uuidValue: value, piiKind: piiKind)
}
}