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

SDK is non static and logging/tracing controls are moved to the connectors #239

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Build/Solutions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ void CheckAndRemoveKnown(string projectName)

CheckAndRemoveKnown("Speckle.Objects");
CheckAndRemoveKnown("Speckle.Sdk");
CheckAndRemoveKnown("Speckle.Sdk.Logging");
if (localProjects.Count != 0)
{
throw new InvalidOperationException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,16 @@ public class ArcGISRootObjectBuilder : IRootObjectBuilder<MapMember>
private readonly IConverterSettingsStore<ArcGISConversionSettings> _settingsStore;
private readonly MapMembersUtils _mapMemberUtils;
private readonly ILogger<ArcGISRootObjectBuilder> _logger;
private readonly ISdkActivityFactory _activityFactory;

public ArcGISRootObjectBuilder(
ISendConversionCache sendConversionCache,
ArcGISColorManager colorManager,
IConverterSettingsStore<ArcGISConversionSettings> settingsStore,
IRootToSpeckleConverter rootToSpeckleConverter,
MapMembersUtils mapMemberUtils,
ILogger<ArcGISRootObjectBuilder> logger
ILogger<ArcGISRootObjectBuilder> logger,
ISdkActivityFactory activityFactory
)
{
_sendConversionCache = sendConversionCache;
Expand All @@ -47,6 +49,7 @@ ILogger<ArcGISRootObjectBuilder> logger
_rootToSpeckleConverter = rootToSpeckleConverter;
_mapMemberUtils = mapMemberUtils;
_logger = logger;
_activityFactory = activityFactory;
}

#pragma warning disable CA1506
Expand Down Expand Up @@ -76,13 +79,13 @@ public async Task<RootObjectBuilderResult> Build(
);

onOperationProgressed?.Invoke("Converting", null);
using (var __ = SpeckleActivityFactory.Start("Converting objects"))
using (var __ = _activityFactory.Start("Converting objects"))
{
foreach ((MapMember mapMember, _) in layersWithDisplayPriority)
{
ct.ThrowIfCancellationRequested();

using (var convertingActivity = SpeckleActivityFactory.Start("Converting object"))
using (var convertingActivity = _activityFactory.Start("Converting object"))
{
var collectionHost = rootObjectCollection;
string applicationId = mapMember.URI;
Expand Down Expand Up @@ -168,13 +171,13 @@ mapMember is not GroupLayer
}

results.Add(new(Status.SUCCESS, applicationId, sourceType, converted));
convertingActivity?.SetStatus(SpeckleActivityStatusCode.Ok);
convertingActivity?.SetStatus(SdkActivityStatusCode.Ok);
}
catch (Exception ex) when (!ex.IsFatal())
{
_logger.LogSendConversionError(ex, sourceType);
results.Add(new(Status.ERROR, applicationId, sourceType, null, ex));
convertingActivity?.SetStatus(SpeckleActivityStatusCode.Error);
convertingActivity?.SetStatus(SdkActivityStatusCode.Error);
convertingActivity?.RecordException(ex);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public SpeckleModule()

var builder = SpeckleContainerBuilder.CreateInstance();
// init DI
_disposableLogger = Connector.Initialize(HostApplications.ArcGIS, GetVersion());
_disposableLogger = Connector.Initialize(HostApplications.ArcGIS, GetVersion(), builder);
adamhathcock marked this conversation as resolved.
Show resolved Hide resolved

Container = builder
.LoadAutofacModules(
Expand Down
35 changes: 17 additions & 18 deletions Connectors/ArcGIS/Speckle.Connectors.ArcGIS3/packages.lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,6 @@
"resolved": "13.0.2",
"contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA=="
},
"Speckle.Sdk.Logging": {
"type": "Transitive",
"resolved": "3.1.0-dev.136",
"contentHash": "X88GqPef05lRuUzxCaR/inWi7eMEpbI8SlOoUaqsNn9mwDiutppIvva3VRK5ARaASvPsunyzWV40TSD6+VH4eA=="
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.4",
Expand Down Expand Up @@ -240,7 +235,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.136, )",
"Speckle.Sdk": "[3.1.0-dev.142, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -251,13 +246,16 @@
"Speckle.Connectors.DUI": "[1.0.0, )"
}
},
"speckle.connectors.logging": {
"type": "Project"
},
"speckle.connectors.utils": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.136, )",
"Speckle.Sdk": "[3.1.0-dev.136, )"
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.142, )",
"Speckle.Sdk": "[3.1.0-dev.142, )"
}
},
"speckle.converters.arcgis3": {
Expand All @@ -279,7 +277,7 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.136, )"
"Speckle.Objects": "[3.1.0-dev.142, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -315,28 +313,29 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.136, )",
"resolved": "3.1.0-dev.136",
"contentHash": "jibrr1zEne7RVNumSd/SkFMRQw5LZS3stM3zk6ZKadAv6eRfnvPB1ZfHhqDiB07TX5Y0SuFCYkI1X5xvLrZsxg==",
"requested": "[3.1.0-dev.142, )",
"resolved": "3.1.0-dev.142",
"contentHash": "zKOwln3evlRcasL9AHHLbkTHsKK+sxUDia3VaafhKNx/fJjqoyhiIPgPjW7xVLfU31pZR2OfTmYBFFcfgH1i/A==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.136"
"Speckle.Sdk": "3.1.0-dev.142"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.136, )",
"resolved": "3.1.0-dev.136",
"contentHash": "rr+TypUJCmLNYa/9TOtFrITZ+5s9AIO7mYqmDwJZQwmu7IQeherqbBPAt9LoCJXcfTQoBW4ci0PmknPbDoTKAw==",
"requested": "[3.1.0-dev.142, )",
"resolved": "3.1.0-dev.142",
"contentHash": "xtPyLVnufvipfT5jIuH9cetqkVn2e+rrJSX9fLObCkbxMCF27fioJPcJ9aOd2ErzrCKXapOVRnlHTaPdfFAdEQ==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "7.0.7",
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0",
"Microsoft.Extensions.Logging": "3.1.0",
"Polly": "7.2.3",
"Polly.Contrib.WaitAndRetry": "1.1.1",
"Polly.Extensions.Http": "3.0.0",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Logging": "3.1.0-dev.136",
"System.Text.Json": "5.0.2"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,6 @@
"resolved": "13.0.2",
"contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA=="
},
"Speckle.Sdk.Logging": {
"type": "Transitive",
"resolved": "3.1.0-dev.136",
"contentHash": "X88GqPef05lRuUzxCaR/inWi7eMEpbI8SlOoUaqsNn9mwDiutppIvva3VRK5ARaASvPsunyzWV40TSD6+VH4eA=="
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.4",
Expand Down Expand Up @@ -318,7 +313,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.136, )",
"Speckle.Sdk": "[3.1.0-dev.142, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -329,13 +324,16 @@
"Speckle.Connectors.DUI": "[1.0.0, )"
}
},
"speckle.connectors.logging": {
"type": "Project"
},
"speckle.connectors.utils": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.136, )",
"Speckle.Sdk": "[3.1.0-dev.136, )"
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.142, )",
"Speckle.Sdk": "[3.1.0-dev.142, )"
}
},
"speckle.converters.autocad2022": {
Expand All @@ -358,7 +356,7 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.136, )"
"Speckle.Objects": "[3.1.0-dev.142, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -403,28 +401,29 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.136, )",
"resolved": "3.1.0-dev.136",
"contentHash": "jibrr1zEne7RVNumSd/SkFMRQw5LZS3stM3zk6ZKadAv6eRfnvPB1ZfHhqDiB07TX5Y0SuFCYkI1X5xvLrZsxg==",
"requested": "[3.1.0-dev.142, )",
"resolved": "3.1.0-dev.142",
"contentHash": "zKOwln3evlRcasL9AHHLbkTHsKK+sxUDia3VaafhKNx/fJjqoyhiIPgPjW7xVLfU31pZR2OfTmYBFFcfgH1i/A==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.136"
"Speckle.Sdk": "3.1.0-dev.142"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.136, )",
"resolved": "3.1.0-dev.136",
"contentHash": "rr+TypUJCmLNYa/9TOtFrITZ+5s9AIO7mYqmDwJZQwmu7IQeherqbBPAt9LoCJXcfTQoBW4ci0PmknPbDoTKAw==",
"requested": "[3.1.0-dev.142, )",
"resolved": "3.1.0-dev.142",
"contentHash": "xtPyLVnufvipfT5jIuH9cetqkVn2e+rrJSX9fLObCkbxMCF27fioJPcJ9aOd2ErzrCKXapOVRnlHTaPdfFAdEQ==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "7.0.7",
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0",
"Microsoft.Extensions.Logging": "3.1.0",
"Polly": "7.2.3",
"Polly.Contrib.WaitAndRetry": "1.1.1",
"Polly.Extensions.Http": "3.0.0",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Logging": "3.1.0-dev.136",
"System.Text.Json": "5.0.2"
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,11 +187,6 @@
"resolved": "13.0.2",
"contentHash": "g1BejUZwax5PRfL6xHgLEK23sqHWOgOj9hE7RvfRRlN00AGt8GnPYt8HedSK7UB3HiRW8zCA9Pn0iiYxCK24BA=="
},
"Speckle.Sdk.Logging": {
"type": "Transitive",
"resolved": "3.1.0-dev.136",
"contentHash": "X88GqPef05lRuUzxCaR/inWi7eMEpbI8SlOoUaqsNn9mwDiutppIvva3VRK5ARaASvPsunyzWV40TSD6+VH4eA=="
},
"SQLitePCLRaw.bundle_e_sqlite3": {
"type": "Transitive",
"resolved": "2.1.4",
Expand Down Expand Up @@ -318,7 +313,7 @@
"Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Connectors.Utils": "[1.0.0, )",
"Speckle.Sdk": "[3.1.0-dev.136, )",
"Speckle.Sdk": "[3.1.0-dev.142, )",
"System.Threading.Tasks.Dataflow": "[6.0.0, )"
}
},
Expand All @@ -329,13 +324,16 @@
"Speckle.Connectors.DUI": "[1.0.0, )"
}
},
"speckle.connectors.logging": {
"type": "Project"
},
"speckle.connectors.utils": {
"type": "Project",
"dependencies": {
"Microsoft.Extensions.Logging": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.136, )",
"Speckle.Sdk": "[3.1.0-dev.136, )"
"Speckle.Connectors.Logging": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.142, )",
"Speckle.Sdk": "[3.1.0-dev.142, )"
}
},
"speckle.converters.autocad2023": {
Expand All @@ -358,7 +356,7 @@
"dependencies": {
"Microsoft.Extensions.Logging.Abstractions": "[3.1.0, )",
"Speckle.Autofac": "[1.0.0, )",
"Speckle.Objects": "[3.1.0-dev.136, )"
"Speckle.Objects": "[3.1.0-dev.142, )"
}
},
"speckle.converters.common.dependencyinjection": {
Expand Down Expand Up @@ -403,28 +401,29 @@
},
"Speckle.Objects": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.136, )",
"resolved": "3.1.0-dev.136",
"contentHash": "jibrr1zEne7RVNumSd/SkFMRQw5LZS3stM3zk6ZKadAv6eRfnvPB1ZfHhqDiB07TX5Y0SuFCYkI1X5xvLrZsxg==",
"requested": "[3.1.0-dev.142, )",
"resolved": "3.1.0-dev.142",
"contentHash": "zKOwln3evlRcasL9AHHLbkTHsKK+sxUDia3VaafhKNx/fJjqoyhiIPgPjW7xVLfU31pZR2OfTmYBFFcfgH1i/A==",
"dependencies": {
"Speckle.Sdk": "3.1.0-dev.136"
"Speckle.Sdk": "3.1.0-dev.142"
}
},
"Speckle.Sdk": {
"type": "CentralTransitive",
"requested": "[3.1.0-dev.136, )",
"resolved": "3.1.0-dev.136",
"contentHash": "rr+TypUJCmLNYa/9TOtFrITZ+5s9AIO7mYqmDwJZQwmu7IQeherqbBPAt9LoCJXcfTQoBW4ci0PmknPbDoTKAw==",
"requested": "[3.1.0-dev.142, )",
"resolved": "3.1.0-dev.142",
"contentHash": "xtPyLVnufvipfT5jIuH9cetqkVn2e+rrJSX9fLObCkbxMCF27fioJPcJ9aOd2ErzrCKXapOVRnlHTaPdfFAdEQ==",
"dependencies": {
"GraphQL.Client": "6.0.0",
"Microsoft.CSharp": "4.7.0",
"Microsoft.Data.Sqlite": "7.0.7",
"Microsoft.Extensions.DependencyInjection.Abstractions": "3.1.0",
"Microsoft.Extensions.Logging": "3.1.0",
"Polly": "7.2.3",
"Polly.Contrib.WaitAndRetry": "1.1.1",
"Polly.Extensions.Http": "3.0.0",
"Speckle.DoubleNumerics": "4.0.1",
"Speckle.Newtonsoft.Json": "13.0.2",
"Speckle.Sdk.Logging": "3.1.0-dev.136",
"System.Text.Json": "5.0.2"
}
},
Expand Down
Loading
Loading