Skip to content

Commit 81cccf2

Browse files
committed
Remove verbose state & value storage debug logging (#1857)
1 parent 4e36bc8 commit 81cccf2

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

src/Core/Services/StateService.cs

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
using System;
22
using Bit.Core.Abstractions;
33
using System.Collections.Generic;
4-
using System.Diagnostics;
54
using System.Linq;
65
using System.Threading.Tasks;
76
using Bit.Core.Enums;
87
using Bit.Core.Models.Data;
98
using Bit.Core.Models.Domain;
109
using Bit.Core.Models.View;
1110
using Bit.Core.Utilities;
12-
using Newtonsoft.Json;
1311

1412
namespace Bit.Core.Services
1513
{
@@ -1183,20 +1181,16 @@ public async Task SetTwoFactorTokenAsync(string value, string email = null)
11831181

11841182
private async Task<T> GetValueAsync<T>(string key, StorageOptions options)
11851183
{
1186-
var value = await GetStorageService(options).GetAsync<T>(key);
1187-
Log("GET", options, key, JsonConvert.SerializeObject(value));
1188-
return value;
1184+
return await GetStorageService(options).GetAsync<T>(key);
11891185
}
11901186

11911187
private async Task SetValueAsync<T>(string key, T value, StorageOptions options)
11921188
{
11931189
if (value == null)
11941190
{
1195-
Log("REMOVE", options, key, null);
11961191
await GetStorageService(options).RemoveAsync(key);
11971192
return;
11981193
}
1199-
Log("SET", options, key, JsonConvert.SerializeObject(value));
12001194
await GetStorageService(options).SaveAsync(key, value);
12011195
}
12021196

@@ -1512,19 +1506,12 @@ private bool UseDisk(StorageOptions options)
15121506

15131507
private async Task<State> GetStateFromStorageAsync()
15141508
{
1515-
var state = await _storageService.GetAsync<State>(Constants.StateKey);
1516-
// TODO Remove logging once all bugs are squished
1517-
Debug.WriteLine(JsonConvert.SerializeObject(state, Formatting.Indented),
1518-
">>> GetStateFromStorageAsync()");
1519-
return state;
1509+
return await _storageService.GetAsync<State>(Constants.StateKey);
15201510
}
15211511

15221512
private async Task SaveStateToStorageAsync(State state)
15231513
{
15241514
await _storageService.SaveAsync(Constants.StateKey, state);
1525-
// TODO Remove logging once all bugs are squished
1526-
Debug.WriteLine(JsonConvert.SerializeObject(state, Formatting.Indented),
1527-
">>> SaveStateToStorageAsync()");
15281515
}
15291516

15301517
private async Task CheckStateAsync()
@@ -1567,17 +1554,5 @@ private async Task ValidateUserAsync(string userId)
15671554
}
15681555
throw new Exception("User does not exist in account list");
15691556
}
1570-
1571-
private void Log(string tag, StorageOptions options, string key, string value)
1572-
{
1573-
// TODO Remove this once all bugs are squished
1574-
var text = options?.UseSecureStorage ?? false ? "SECURE / " : "";
1575-
text += "Key: " + key + " / ";
1576-
if (value != null)
1577-
{
1578-
text += "Value: " + value;
1579-
}
1580-
Debug.WriteLine(text, ">>> " + tag);
1581-
}
15821557
}
15831558
}

0 commit comments

Comments
 (0)