FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
code-server/test/utils/wtfnode.ts at v4.11.0 · coder/code-server · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
coder
/
code-server
Public
Notifications
You must be signed in to change notification settings
Fork
6.8k
Star
79.3k
Code
Issues
143
Pull requests
10
Discussions
Actions
Projects
Security and quality
1
Insights
Additional navigation options
Code
Issues
Pull requests
Discussions
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
code-server
/
test
/
utils
/
wtfnode.ts
Copy path
More file actions
More file actions
Latest commit
History
History
History
35 lines (31 loc) · 847 Bytes
Breadcrumbs
code-server
/
test
/
utils
/
wtfnode.ts
Copy path
File metadata and controls
35 lines (31 loc) · 847 Bytes
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
import
*
as
util
from
"util"
import
*
as
wtfnode
from
"wtfnode"
// Jest seems to hijack console.log in a way that makes the output difficult to
// read. So we'll write directly to process.stderr instead.
const
write
=
(
...
args
:
[
any
,
...
any
]
)
=>
{
if
(
args
.
length
>
0
)
{
process
.
stderr
.
write
(
util
.
format
(
...
args
)
+
"\n"
)
}
}
wtfnode
.
setLogger
(
"info"
,
write
)
wtfnode
.
setLogger
(
"warn"
,
write
)
wtfnode
.
setLogger
(
"error"
,
write
)
let
active
=
false
/**
* Start logging open handles periodically. This can be used to see what is
* hanging open if anything.
*/
export
function
setup
(
)
:
void
{
if
(
active
)
{
return
}
active
=
true
const
interval
=
5000
const
wtfnodeDump
=
(
)
=>
{
wtfnode
.
dump
(
)
const
t
=
setTimeout
(
wtfnodeDump
,
interval
)
t
.
unref
(
)
}
const
t
=
setTimeout
(
wtfnodeDump
,
interval
)
t
.
unref
(
)
}
Back
|
FazBrowse Home
|
New Git URL