mirror of
https://github.com/github/codeql.git
synced 2026-04-25 16:55:19 +02:00
Python: Add logging.Logger model
This commit is contained in:
committed by
Rasmus Wriedt Larsen
parent
dea61e14d1
commit
9d93afe128
@@ -255,8 +255,10 @@ module Stdlib {
|
||||
*/
|
||||
module Logger {
|
||||
/** Gets a reference to the `logging.Logger` class or any subclass. */
|
||||
private API::Node subclassRef() {
|
||||
API::Node subclassRef() {
|
||||
result = API::moduleImport("logging").getMember("Logger").getASubclass*()
|
||||
or
|
||||
result = ModelOutput::getATypeNode("logging.Logger~Subclass").getASubclass*()
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -404,6 +404,12 @@ class Urllib3PoolManager extends FindSubclassesSpec {
|
||||
override API::Node getAlreadyModeledClass() { result = Urllib3::PoolManager::classRef() }
|
||||
}
|
||||
|
||||
class StdlibLogger extends FindSubclassesSpec {
|
||||
StdlibLogger() { this = "logging.Logger~Subclass" }
|
||||
|
||||
override API::Node getAlreadyModeledClass() { result = Stdlib::Logger::subclassRef() }
|
||||
}
|
||||
|
||||
bindingset[fullyQualified]
|
||||
predicate fullyQualifiedToYamlFormat(string fullyQualified, string type2, string path) {
|
||||
exists(int firstDot | firstDot = fullyQualified.indexOf(".", 0, 0) |
|
||||
|
||||
Reference in New Issue
Block a user