Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The objective C wrapper should support all LogConfiguration settings that v1 did #347

Open
kindbe opened this issue May 6, 2020 · 4 comments
Labels
iOS iOS related issue ODSP Partner Team - OneDrive and SharePoint OTEL Partner Team - Microsoft Office Telemetry team

Comments

@kindbe
Copy link
Contributor

kindbe commented May 6, 2020

Right now it only supports two, but teams like OneDrive and Outlook will need more.

@maxgolov
Copy link
Contributor

maxgolov commented May 6, 2020

Can you use this: https://developer.apple.com/documentation/foundation/nsjsonserialization to maybe transform from ILogConfiguration to a "A Foundation object"? I'm not very familiar with Obj-C. But it appears that you might be able to use JSON to marshal from ILogConfiguration to a Foundation object, then have a method LogManager::Configure bound to perform the marshaling of a Foundation object via JSON string, and re-configure the ILogConfiguration based on that. That's a bit costly, but since it's very infrequent operation (once) - we can measure how much it takes. It'd probably be less code than manually individually copying all fields and settings one by one.

I'm trying hard to remember how I did the code that transforms from populated ILogConfiguration into JSON (which was done to create JSON config files for ILogConfiguration in EventSender example). It was something to do with Variant to JSON code, maybe in Variant.hpp

@maxgolov maxgolov added OTEL Partner Team - Microsoft Office Telemetry team ODSP Partner Team - OneDrive and SharePoint iOS iOS related issue labels May 6, 2020
@kindbe
Copy link
Contributor Author

kindbe commented May 11, 2020

Looking at bringing parity with the v1 obj-c SDK, everything looks to have a 1DS counterpart except this:

/*!
@brief [optional] Cause user session events to be sent automatically.
*/
@Property (nonatomic, assign) BOOL enableAutoUserSession;

@kindbe kindbe changed the title The objective C wrapper should support all LogConfiguration settings The objective C wrapper should support all LogConfiguration settings that v1 did May 11, 2020
@maxgolov
Copy link
Contributor

maxgolov commented May 11, 2020

We do not currently support automatic session logging in 1DS SDK. I'm not sure about the exact logical reason why. Session Id should automatically allocated though, here:

// Initializer for Session Data object

m_logSessionData.reset(new LogSessionData(cacheFilePath));

// Getter for Session Data object
https://github.com/microsoft/cpp/_client_telemetry/blob/9444ff278acbcce2a0084ade429d4ce571ff7fe5/lib/api/LogManagerImpl.cpp#L626

Populated on ext.sdk.installId

record.extSdk[0].installId = m_owner.GetLogSessionData()->getSessionSDKUid();

We can add LogSession(...) API calls in Initialize and FlushAndTeardown at C++ layer if the flag is set. I think there were practical reasons why we could not generally assume that those are the rightful places: since ideally the OS may at any time put the app to sleep (without us knowing if it's gonna be resumed or not). For that matter it should probably be manually handled by the app in some form of OS-specific "onResuming" / "onSuspending" handler code? Basically the app calling LogSession(...) manually.

@maxgolov
Copy link
Contributor

Just checking with you guys, if the iOS wrapper already supports all the options you need? Can this issue be closed?
Tagging folks working on Obj-C layer: @kindbe @eduardo-camacho @agavipul @kivarsha

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
iOS iOS related issue ODSP Partner Team - OneDrive and SharePoint OTEL Partner Team - Microsoft Office Telemetry team
Projects
None yet
Development

No branches or pull requests

2 participants