Skip to content

Commit f6f788e

Browse files
authored
feat(SocketLogging): add SocketLogging function (#556)
* feat: 增加日志逻辑 * feat: 增加日志初始化逻辑 * chore: update namespace * chore: bump version 9.0.5
1 parent d0db0be commit f6f788e

39 files changed

Lines changed: 127 additions & 44 deletions
Lines changed: 28 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,42 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22

33
<PropertyGroup>
4-
<Version>9.0.4</Version>
4+
<Version>9.0.5</Version>
55
</PropertyGroup>
66

77
<PropertyGroup>
88
<PackageTags>BootstrapBlazor Socket</PackageTags>
99
<Description>BootstrapBlazor extensions of Socket</Description>
1010
</PropertyGroup>
1111

12+
<PropertyGroup>
13+
<NET8Version>8.0.*</NET8Version>
14+
<NET9Version>9.0.*</NET9Version>
15+
</PropertyGroup>
16+
17+
<ItemGroup Condition="'$(TargetFramework)' == 'net6.0'">
18+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(NET8Version)" />
19+
</ItemGroup>
20+
21+
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
22+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(NET8Version)" />
23+
</ItemGroup>
24+
25+
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
26+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(NET9Version)" />
27+
</ItemGroup>
28+
29+
<ItemGroup Condition="'$(TargetFramework)' == 'net9.0'">
30+
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(NET9Version)" />
31+
</ItemGroup>
32+
33+
<ItemGroup>
34+
</ItemGroup>
35+
1236
<ItemGroup>
13-
<Using Include="BootstrapBlazor.DataAdapters" />
14-
<Using Include="BootstrapBlazor.DataHandlers" />
15-
<Using Include="BootstrapBlazor.DataConverters" />
37+
<Using Include="BootstrapBlazor.Socket.DataAdapters" />
38+
<Using Include="BootstrapBlazor.Socket.DataHandlers" />
39+
<Using Include="BootstrapBlazor.Socket.DataConverters" />
1640
</ItemGroup>
1741

1842
</Project>

src/extensions/BootstrapBlazor.Socket/DataAdapter/DataPackageAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5-
namespace BootstrapBlazor.DataAdapters;
5+
namespace BootstrapBlazor.Socket.DataAdapters;
66

77
/// <summary>
88
/// Provides a base implementation for adapting data packages between different systems or formats.

src/extensions/BootstrapBlazor.Socket/DataAdapter/IDataPackageAdapter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5-
namespace BootstrapBlazor.DataAdapters;
5+
namespace BootstrapBlazor.Socket.DataAdapters;
66

77
/// <summary>
88
/// Defines an adapter for handling and transmitting data packages to a target destination.

src/extensions/BootstrapBlazor.Socket/DataConverter/BinConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using System.Text;
66

7-
namespace BootstrapBlazor.Components.DataConverter;
7+
namespace BootstrapBlazorSocket.DataConverter;
88

99
/// <summary>
1010
/// 二进制 与 Byte 数组转换方法

src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverter.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5+
using BootstrapBlazor.Socket.Logging;
56
using System.Reflection;
67

7-
namespace BootstrapBlazor.DataConverters;
8+
namespace BootstrapBlazor.Socket.DataConverters;
89

910
/// <summary>
1011
/// Provides a base class for converting socket data into a specified entity type.
@@ -38,7 +39,10 @@ public virtual bool TryConvertTo(ReadOnlyMemory<byte> data, [NotNullWhen(true)]
3839
ret = true;
3940
}
4041
}
41-
catch { }
42+
catch (Exception ex)
43+
{
44+
SocketLogging.LogError(ex, "DataConverter TryConvertTo failed");
45+
}
4246

4347
return ret;
4448
}

src/extensions/BootstrapBlazor.Socket/DataConverter/DataConverterCollections.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
using System.Linq.Expressions;
77
using System.Reflection;
88

9-
namespace BootstrapBlazor.DataConverters;
9+
namespace BootstrapBlazor.Socket.DataConverters;
1010

1111
/// <summary>
1212
/// 数据转换器集合类

src/extensions/BootstrapBlazor.Socket/DataConverter/DataPropertyConverterAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5-
namespace BootstrapBlazor.DataConverters;
5+
namespace BootstrapBlazor.Socket.DataConverters;
66

77
/// <summary>
88
/// Represents an attribute used to mark a field as a socket data field.

src/extensions/BootstrapBlazor.Socket/DataConverter/DataTypeConverterAttribute.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5-
namespace BootstrapBlazor.DataConverters;
5+
namespace BootstrapBlazor.Socket.DataConverters;
66

77
/// <summary>
88
///

src/extensions/BootstrapBlazor.Socket/DataConverter/HexConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5-
namespace BootstrapBlazor.Components.DataConverter;
5+
namespace BootstrapBlazor.Socket.DataConverter;
66

77
/// <summary>
88
/// 十六进制 与 Byte 数组转换方法

src/extensions/BootstrapBlazor.Socket/DataConverter/IDataConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33
// Website: https://www.blazor.zone or https://argozhang.github.io/
44

5-
namespace BootstrapBlazor.DataConverters;
5+
namespace BootstrapBlazor.Socket.DataConverters;
66

77
/// <summary>
88
/// Socket 数据转换器接口

0 commit comments

Comments
 (0)