MCPcopy Create free account
hub / github.com/apache/skywalking-php / hook

Method hook

src/plugin/plugin_psr3.rs:54–78  ·  view source on GitHub ↗
(
        &self, class_name: Option<&str>, function_name: &str,
    )

Source from the content-addressed store, hash-verified

52 }
53
54 fn hook(
55 &self, class_name: Option<&str>, function_name: &str,
56 ) -> Option<(
57 Box<crate::execute::BeforeExecuteHook>,
58 Box<crate::execute::AfterExecuteHook>,
59 )> {
60 let class_name = class_name?;
61 match &*function_name.to_uppercase() {
62 "EMERGENCY" | "ALERT" | "CRITICAL" | "ERROR" | "WARNING" | "NOTICE" | "INFO"
63 | "DEBUG" => {
64 let log_level = function_name.into();
65 if log_level >= *PSR_LOGGING_LEVEL {
66 Some(self.hook_log_methods(
67 class_name.to_owned(),
68 function_name.to_owned(),
69 log_level,
70 ))
71 } else {
72 None
73 }
74 }
75 "LOG" => Some(self.hook_log(class_name.to_owned(), function_name.to_owned())),
76 _ => None,
77 }
78 }
79}
80
81impl Psr3Plugin {

Callers

nothing calls this directly

Calls 2

hook_log_methodsMethod · 0.80
hook_logMethod · 0.80

Tested by

no test coverage detected