FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
SharpGenTools/SharpGenTools.Sdk/MSBuildSharpGenLogger.cs at main · SharpGenTools/SharpGenTools · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
SharpGenTools
/
SharpGenTools
Public
Notifications
You must be signed in to change notification settings
Fork
60
Star
536
Code
Issues
44
Pull requests
1
Discussions
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
SharpGenTools
/
SharpGenTools.Sdk
/
MSBuildSharpGenLogger.cs
Copy path
More file actions
More file actions
Latest commit
History
History
History
55 lines (49 loc) · 1.78 KB
Breadcrumbs
SharpGenTools
/
SharpGenTools.Sdk
/
MSBuildSharpGenLogger.cs
Copy path
File metadata and controls
55 lines (49 loc) · 1.78 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
using
System
;
using
Microsoft
.
Build
.
Framework
;
using
Microsoft
.
Build
.
Utilities
;
using
SharpGen
.
Logging
;
using
ILogger
=
SharpGen
.
Logging
.
ILogger
;
namespace
SharpGenTools
.
Sdk
;
internal
sealed
class
MSBuildSharpGenLogger
:
ILogger
{
private
readonly
TaskLoggingHelper
log
;
public
MSBuildSharpGenLogger
(
TaskLoggingHelper
log
)
{
this
.
log
=
log
;
}
public
void
Exit
(
string
reason
,
int
exitCode
)
{
log
.
LogError
(
reason
??
""
)
;
throw
new
CodeGenFailedException
(
reason
??
""
)
;
}
public
void
Log
(
LogLevel
logLevel
,
LogLocation
logLocation
,
string
context
,
string
code
,
string
message
,
Exception
exception
,
params
object
[
]
parameters
)
{
if
(
message
==
null
)
{
return
;
}
switch
(
logLevel
)
{
case
LogLevel
.
Info
:
log
.
LogMessage
(
context
,
code
,
null
,
logLocation
?
.
File
,
logLocation
?
.
Line
??
0
,
logLocation
?
.
Column
??
0
,
0
,
0
,
MessageImportance
.
Normal
,
message
,
parameters
)
;
break
;
case
LogLevel
.
Warning
:
log
.
LogWarning
(
context
,
code
,
null
,
logLocation
?
.
File
,
logLocation
?
.
Line
??
0
,
logLocation
?
.
Column
??
0
,
0
,
0
,
message
,
parameters
)
;
if
(
exception
!=
null
)
{
log
.
LogWarningFromException
(
exception
)
;
}
break
;
case
LogLevel
.
Error
:
case
LogLevel
.
Fatal
:
log
.
LogError
(
context
,
code
,
null
,
logLocation
?
.
File
,
logLocation
?
.
Line
??
0
,
logLocation
?
.
Column
??
0
,
0
,
0
,
message
,
parameters
)
;
if
(
exception
!=
null
)
{
log
.
LogErrorFromException
(
exception
,
true
,
true
,
null
)
;
}
break
;
default
:
break
;
}
}
}
Back
|
FazBrowse Home
|
New Git URL