Skip to content

Commit 3a646b8

Browse files
authored
Add docs for tracing warnings (fastify#5310)
1 parent 2f4f5f5 commit 3a646b8

File tree

1 file changed

+15
-2
lines changed

1 file changed

+15
-2
lines changed

docs/Reference/Warnings.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,21 @@
2929
## Warnings
3030

3131
### Warnings In Fastify
32-
Warnings are enabled by default. They can be disabled by using any
33-
of the following methods:
32+
33+
Fastify utilizes Node.js's [warning event](https://nodejs.org/api/process.html#event-warning)
34+
API to notify users of deprecated features and known coding mistakes. Fastify's
35+
warnings are recognizable by the `FSTWRN` and `FSTDEP` prefixes on warning
36+
code. When encountering such a warning, it is highly recommended that the
37+
cause of the warning be determined through use of the
38+
[`--trace-warnings`](https://nodejs.org/api/cli.html#--trace-warnings) and
39+
[`--trace-deprecation`](https://nodejs.org/api/cli.html#--trace-deprecation)
40+
flags. These will produce stack traces pointing out where the issue occurs
41+
in the application's code. Issues opened about warnings without including
42+
this information may be closed due to lack of information.
43+
44+
In addition to tracing, warnings can also be disabled. It is not recommended to
45+
disable warnings as a matter of course, but if necessary, they can be disabled
46+
by using any of the following methods:
3447

3548
- setting the `NODE_NO_WARNINGS` environment variable to `1`
3649
- passing the `--no-warnings` flag to the node process

0 commit comments

Comments
 (0)