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

Integrate Core logging #3277

Merged
merged 5 commits into from
Mar 31, 2023
Merged

Integrate Core logging #3277

merged 5 commits into from
Mar 31, 2023

Conversation

nirinchev
Copy link
Member

@nirinchev nirinchev commented Mar 27, 2023

Description

Fixes #2910

This will fail on CI due to realm/realm-core#6443, but that is a regression in Core and not something that will affect the feature's implementation.

TODO

  • Changelog entry
  • Tests (if applicable)

@cla-bot cla-bot bot added the cla: yes label Mar 27, 2023
@coveralls
Copy link

coveralls commented Mar 27, 2023

Pull Request Test Coverage Report for Build 4574802572

  • 8 of 8 (100.0%) changed or added relevant lines in 3 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.07%) to 81.943%

Files with Coverage Reduction New Missed Lines %
Realm/Realm/Logging/Logger.cs 1 55.32%
Totals Coverage Status
Change from base Build 4534934647: 0.07%
Covered Lines: 5875
Relevant Lines: 7040

💛 - Coveralls

Base automatically changed from ni/incompatible-synced-file to main March 27, 2023 17:40
Comment on lines 180 to 188
NativeMethods.initialize(
frameworkName, frameworkName.IntPtrLength(),
frameworkVersion, frameworkVersion.IntPtrLength(),
sdkVersion, sdkVersion.IntPtrLength(),
platformVersion, platformVersion.IntPtrLength(),
cpuArch, cpuArch.IntPtrLength(),
deviceName, deviceName.IntPtrLength(),
deviceVersion, deviceVersion.IntPtrLength(),
userLogin, taskCallback, stringCallback, logMessage, apiKeysCallback);
userLogin, taskCallback, stringCallback, apiKeysCallback);

Check notice

Code scanning / CodeQL

Calls to unmanaged code

Replace this call with a call to managed code if possible.
@@ -272,6 +275,8 @@
NativeMethods.install_callbacks(notifyRealm, getNativeSchema, openRealm, disposeGCHandle, logMessage, notifyObject, notifyDictionary, onMigration, shouldCompact, handleTaskCompletion, onInitialization);
}

public static void SetLogLevel(LogLevel level) => NativeMethods.set_log_level(level);

Check notice

Code scanning / CodeQL

Calls to unmanaged code

Replace this call with a call to managed code if possible.
@@ -234,6 +234,9 @@
[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_refresh_async", CallingConvention = CallingConvention.Cdecl)]
public static extern bool refresh_async(SharedRealmHandle realm, IntPtr tcs_handle, out NativeException ex);

[DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_set_log_level", CallingConvention = CallingConvention.Cdecl)]
public static extern bool set_log_level(LogLevel level);

Check notice

Code scanning / CodeQL

Unmanaged code

Minimise the use of unmanaged code.
Realm/Realm/Logging/Logger.cs Fixed Show fixed Hide fixed
@nirinchev nirinchev marked this pull request as ready for review March 28, 2023 01:39
@nirinchev nirinchev linked an issue Mar 28, 2023 that may be closed by this pull request
@nirinchev nirinchev added the no-changelog Used to skip the changelog check label Mar 28, 2023
get => _logLevel;
set
{
_logLevel = value;

Check notice

Code scanning / CodeQL

Static field written by instance method

Write to static field from instance method or constructor.
@nirinchev nirinchev removed the no-changelog Used to skip the changelog check label Mar 31, 2023
@nirinchev nirinchev merged commit 004b256 into main Mar 31, 2023
@nirinchev nirinchev deleted the ni/logging branch March 31, 2023 13:22
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Core Logging
2 participants