FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
Dart-Code/src/debug/logging.ts at master · optifact/Dart-Code · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
optifact
/
Dart-Code
Public
forked from
Dart-Code/Dart-Code
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Dart-Code
/
src
/
debug
/
logging.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
24 lines (21 loc) · 1.09 KB
Breadcrumbs
Dart-Code
/
src
/
debug
/
logging.ts
Copy path
File metadata and controls
24 lines (21 loc) · 1.09 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
import
{
Event
}
from
"@vscode/debugadapter"
;
import
{
DebugProtocol
}
from
"@vscode/debugprotocol"
;
import
{
LogCategory
,
LogSeverity
}
from
"../shared/enums"
;
import
{
Logger
,
LogMessage
}
from
"../shared/interfaces"
;
import
{
errorString
}
from
"../shared/utils"
;
// A logger that passes log events back to the UI in `dart.log` events.
export
class
DebugAdapterLogger
implements
Logger
{
constructor
(
private
readonly
debugClient
:
{
sendEvent
:
(
event
:
DebugProtocol
.
Event
)
=>
void
}
,
private
readonly
category
:
LogCategory
)
{
}
private
log
(
message
:
string
,
severity
:
LogSeverity
,
category
=
this
.
category
)
:
void
{
this
.
debugClient
.
sendEvent
(
new
Event
(
"dart.log"
,
{
message
,
severity
,
category
}
as
LogMessage
)
)
;
}
public
info
(
message
:
string
,
category
?:
LogCategory
)
:
void
{
this
.
log
(
message
,
LogSeverity
.
Info
,
category
)
;
}
public
warn
(
errorOrMessage
:
any
,
category
?:
LogCategory
)
:
void
{
this
.
log
(
errorString
(
errorOrMessage
)
,
LogSeverity
.
Warn
,
category
)
;
}
public
error
(
errorOrMessage
:
any
,
category
?:
LogCategory
)
:
void
{
this
.
log
(
errorString
(
errorOrMessage
)
,
LogSeverity
.
Error
,
category
)
;
}
}
Back
|
FazBrowse Home
|
New Git URL