add basic support for the pino library

This commit is contained in:
Erik Krogh Kristensen
2021-07-12 15:36:32 +02:00
parent cb1b227c87
commit cce15bed1d
4 changed files with 58 additions and 0 deletions

View File

@@ -337,3 +337,28 @@ class StripAnsiStep extends TaintTracking::SharedTaintStep {
)
}
}
/**
* Provides classes and predicates for working with the `pino` library.
*/
private module Pino {
/**
* Gets a logger instance from the `pino` library.
*/
private API::Node pino() {
result = API::moduleImport("pino").getReturn()
or
result = pino().getMember("child").getReturn()
}
/**
* A logging call to the `pino` library.
*/
private class PinoCall extends LoggerCall {
PinoCall() {
this = pino().getMember(["trace", "debug", "info", "warn", "error", "fatal"]).getACall()
}
override DataFlow::Node getAMessageComponent() { result = getArgument(0) }
}
}