Skip to content

Commit

Permalink
try fix unused logs and add temporary trace
Browse files Browse the repository at this point in the history
  • Loading branch information
0xF6 committed Aug 3, 2024
1 parent 07f3b8d commit 77aeadd
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
6 changes: 5 additions & 1 deletion src/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
"Logging": {
"Debug": {
"LogLevel": {
"Default": "Debug"
"Default": "Debug",
"Microsoft.AspNetCore.Hosting": "Warning",
"Microsoft.AspNetCore.Infrastructure": "Warning",
"Microsoft.AspNetCore.Routing": "Warning",
"Microsoft.AspNetCore.Mvc": "Warning"
}
},
"Console": {
Expand Down
4 changes: 3 additions & 1 deletion src/controllers/PackagePublishController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ public async Task Upload(CancellationToken cancellationToken)
return;
}

var me = await userService.GetMeAsync(cancellationToken);
var me = await userService.GetMeAsync(cancellationToken);

logger.LogInformation($"indexer.IndexAsync");
var result = await indexer.IndexAsync(uploadStream, me, cancellationToken);

switch (result.Item1)
Expand Down
10 changes: 6 additions & 4 deletions src/logic/services/PackageIndexingService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,12 @@ public class PackageIndexingService(
var iconStream = default(Stream);

try
{
var packageReader = await Shard.OpenAsync(packageStream, true, token);
{
logger.LogInformation($"Shard.OpenAsync");
var packageReader = await Shard.OpenAsync(packageStream, true, token);
logger.LogInformation($"packageReader.GetManifestAsync");
var manifest = await packageReader.GetManifestAsync(token);

logger.LogInformation($"userService.UserAllowedPublishWorkloads");
if (manifest.IsWorkload && !await userService.UserAllowedPublishWorkloads())
return (PackageIndexingResult.InvalidPackage, "You cannot publish workload package!");

Expand All @@ -45,7 +47,7 @@ public class PackageIndexingService(
readmeStream = await packageReader.GetReadmeAsync(token);
if (package.HasEmbeddedIcon)
iconStream = await packageReader.GetIconAsync(token);

logger.LogInformation($"PackageValidator.ValidateExistAsync");
await PackageValidator.ValidateExistAsync(packageReader);
}
catch (ShardPackageCorruptedException e) when (e.InnerException is PackageValidatorException validateError)
Expand Down
2 changes: 1 addition & 1 deletion src/logic/services/searchs/FirestoreSearchService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public class FireOperationBuilder(FirestoreDb firestore, IMapper mapper, IUserSe
public async Task<WriteResult> AddPackage(Package package, UserRecord owner)
{
if (package == null) throw new ArgumentNullException(nameof(package));
if (owner == null) throw new ArgumentNullException(nameof(owner));
if (owner == null) throw new ArgumentNullException(nameof(owner));

var version = package.Version;
var normalizedVersion = version.ToNormalizedString();
Expand Down

0 comments on commit 77aeadd

Please sign in to comment.