Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
dotNET Platform
runtime
提交
ececd642
R
runtime
项目概览
dotNET Platform
/
runtime
12 个月 前同步成功
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
runtime
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
ececd642
编写于
4月 01, 2022
作者:
M
Maksym Koshovyi
提交者:
GitHub
4月 01, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[Group 4] Enable nullable annotations for `Microsoft.Extensions.Logging.EventLog` (#67200)
上级
0d1e04ba
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
20 addition
and
18 deletion
+20
-18
src/libraries/Microsoft.Extensions.Logging.EventLog/ref/Microsoft.Extensions.Logging.EventLog.cs
...ing.EventLog/ref/Microsoft.Extensions.Logging.EventLog.cs
+5
-5
src/libraries/Microsoft.Extensions.Logging.EventLog/ref/Microsoft.Extensions.Logging.EventLog.csproj
...EventLog/ref/Microsoft.Extensions.Logging.EventLog.csproj
+1
-0
src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLogger.cs
...crosoft.Extensions.Logging.EventLog/src/EventLogLogger.cs
+6
-6
src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLoggerProvider.cs
...Extensions.Logging.EventLog/src/EventLogLoggerProvider.cs
+2
-2
src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogSettings.cs
...osoft.Extensions.Logging.EventLog/src/EventLogSettings.cs
+5
-5
src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
...EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
+1
-0
未找到文件。
src/libraries/Microsoft.Extensions.Logging.EventLog/ref/Microsoft.Extensions.Logging.EventLog.cs
浏览文件 @
ececd642
...
...
@@ -19,7 +19,7 @@ namespace Microsoft.Extensions.Logging.EventLog
public
partial
class
EventLogLoggerProvider
:
Microsoft
.
Extensions
.
Logging
.
ILoggerProvider
,
Microsoft
.
Extensions
.
Logging
.
ISupportExternalScope
,
System
.
IDisposable
{
public
EventLogLoggerProvider
()
{
}
public
EventLogLoggerProvider
(
Microsoft
.
Extensions
.
Logging
.
EventLog
.
EventLogSettings
settings
)
{
}
public
EventLogLoggerProvider
(
Microsoft
.
Extensions
.
Logging
.
EventLog
.
EventLogSettings
?
settings
)
{
}
public
EventLogLoggerProvider
(
Microsoft
.
Extensions
.
Options
.
IOptions
<
Microsoft
.
Extensions
.
Logging
.
EventLog
.
EventLogSettings
>
options
)
{
}
public
Microsoft
.
Extensions
.
Logging
.
ILogger
CreateLogger
(
string
name
)
{
throw
null
;
}
public
void
Dispose
()
{
}
...
...
@@ -28,9 +28,9 @@ public partial class EventLogLoggerProvider : Microsoft.Extensions.Logging.ILogg
public
partial
class
EventLogSettings
{
public
EventLogSettings
()
{
}
public
System
.
Func
<
string
,
Microsoft
.
Extensions
.
Logging
.
LogLevel
,
bool
>
Filter
{
get
{
throw
null
;
}
set
{
}
}
public
string
LogName
{
get
{
throw
null
;
}
set
{
}
}
public
string
MachineName
{
get
{
throw
null
;
}
set
{
}
}
public
string
SourceName
{
get
{
throw
null
;
}
set
{
}
}
public
System
.
Func
<
string
,
Microsoft
.
Extensions
.
Logging
.
LogLevel
,
bool
>
?
Filter
{
get
{
throw
null
;
}
set
{
}
}
public
string
?
LogName
{
get
{
throw
null
;
}
set
{
}
}
public
string
?
MachineName
{
get
{
throw
null
;
}
set
{
}
}
public
string
?
SourceName
{
get
{
throw
null
;
}
set
{
}
}
}
}
src/libraries/Microsoft.Extensions.Logging.EventLog/ref/Microsoft.Extensions.Logging.EventLog.csproj
浏览文件 @
ececd642
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
...
...
src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLogger.cs
浏览文件 @
ececd642
...
...
@@ -15,7 +15,7 @@ internal sealed class EventLogLogger : ILogger
{
private
readonly
string
_name
;
private
readonly
EventLogSettings
_settings
;
private
readonly
IExternalScopeProvider
_externalScopeProvider
;
private
readonly
IExternalScopeProvider
?
_externalScopeProvider
;
private
const
string
ContinuationString
=
"..."
;
private
readonly
int
_beginOrEndMessageSegmentSize
;
...
...
@@ -27,7 +27,7 @@ internal sealed class EventLogLogger : ILogger
/// <param name="name">The name of the logger.</param>
/// <param name="settings">The <see cref="EventLogSettings"/>.</param>
/// <param name="externalScopeProvider">The <see cref="IExternalScopeProvider"/>.</param>
public
EventLogLogger
(
string
name
!!,
EventLogSettings
settings
!!,
IExternalScopeProvider
externalScopeProvider
)
public
EventLogLogger
(
string
name
!!,
EventLogSettings
settings
!!,
IExternalScopeProvider
?
externalScopeProvider
)
{
_name
=
name
;
_settings
=
settings
;
...
...
@@ -48,7 +48,7 @@ public EventLogLogger(string name!!, EventLogSettings settings!!, IExternalScope
public
IEventLog
EventLog
{
get
;
}
/// <inheritdoc />
public
IDisposable
BeginScope
<
TState
>(
TState
state
)
public
IDisposable
?
BeginScope
<
TState
>(
TState
state
)
where
TState
:
notnull
{
return
_externalScopeProvider
?.
Push
(
state
);
}
...
...
@@ -65,8 +65,8 @@ public bool IsEnabled(LogLevel logLevel)
LogLevel
logLevel
,
EventId
eventId
,
TState
state
,
Exception
exception
,
Func
<
TState
,
Exception
,
string
>
formatter
)
Exception
?
exception
,
Func
<
TState
,
Exception
?
,
string
>
formatter
)
{
if
(!
IsEnabled
(
logLevel
))
{
...
...
@@ -129,7 +129,7 @@ private void WriteMessage(string message, EventLogEntryType eventLogEntryType, i
}
int
startIndex
=
0
;
string
messageSegment
=
null
;
string
?
messageSegment
=
null
;
while
(
true
)
{
// Begin segment
...
...
src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogLoggerProvider.cs
浏览文件 @
ececd642
...
...
@@ -13,7 +13,7 @@ public class EventLogLoggerProvider : ILoggerProvider, ISupportExternalScope
{
internal
readonly
EventLogSettings
_settings
;
private
IExternalScopeProvider
_scopeProvider
;
private
IExternalScopeProvider
?
_scopeProvider
;
/// <summary>
/// Initializes a new instance of the <see cref="EventLogLoggerProvider"/> class.
...
...
@@ -27,7 +27,7 @@ public EventLogLoggerProvider()
/// Initializes a new instance of the <see cref="EventLogLoggerProvider"/> class.
/// </summary>
/// <param name="settings">The <see cref="EventLogSettings"/>.</param>
public
EventLogLoggerProvider
(
EventLogSettings
settings
)
public
EventLogLoggerProvider
(
EventLogSettings
?
settings
)
{
_settings
=
settings
??
new
EventLogSettings
();
}
...
...
src/libraries/Microsoft.Extensions.Logging.EventLog/src/EventLogSettings.cs
浏览文件 @
ececd642
...
...
@@ -10,27 +10,27 @@ namespace Microsoft.Extensions.Logging.EventLog
/// </summary>
public
class
EventLogSettings
{
private
IEventLog
_eventLog
;
private
IEventLog
?
_eventLog
;
/// <summary>
/// Name of the event log. If <c>null</c> or not specified, "Application" is the default.
/// </summary>
public
string
LogName
{
get
;
set
;
}
public
string
?
LogName
{
get
;
set
;
}
/// <summary>
/// Name of the event log source. If <c>null</c> or not specified, ".NET Runtime" is the default.
/// </summary>
public
string
SourceName
{
get
;
set
;
}
public
string
?
SourceName
{
get
;
set
;
}
/// <summary>
/// Name of the machine having the event log. If <c>null</c> or not specified, local machine is the default.
/// </summary>
public
string
MachineName
{
get
;
set
;
}
public
string
?
MachineName
{
get
;
set
;
}
/// <summary>
/// The function used to filter events based on the log level.
/// </summary>
public
Func
<
string
,
LogLevel
,
bool
>
Filter
{
get
;
set
;
}
public
Func
<
string
,
LogLevel
,
bool
>
?
Filter
{
get
;
set
;
}
internal
IEventLog
EventLog
{
...
...
src/libraries/Microsoft.Extensions.Logging.EventLog/src/Microsoft.Extensions.Logging.EventLog.csproj
浏览文件 @
ececd642
...
...
@@ -2,6 +2,7 @@
<PropertyGroup>
<TargetFrameworks>$(NetCoreAppCurrent);$(NetCoreAppMinimum);netstandard2.0;$(NetFrameworkMinimum)</TargetFrameworks>
<Nullable>enable</Nullable>
<EnableDefaultItems>true</EnableDefaultItems>
<!-- Use targeting pack references instead of granular ones in the project file. -->
<DisableImplicitAssemblyReferences>false</DisableImplicitAssemblyReferences>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录