/var/www/html_de/wp-content/plugins/query-monitor/classes/QM.php


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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
<?php declare(strict_types 1);
/**
 * A convenience class for wrapping certain user-facing functionality.
 *
 * @package query-monitor
 */

class QM {

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function emergency$message, array $context = array() ) {
        
/**
         * Fires when an `emergency` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/emergency'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function alert$message, array $context = array() ) {
        
/**
         * Fires when an `alert` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/alert'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function critical$message, array $context = array() ) {
        
/**
         * Fires when a `critical` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/critical'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function error$message, array $context = array() ) {
        
/**
         * Fires when an `error` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/error'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function warning$message, array $context = array() ) {
        
/**
         * Fires when a `warning` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/warning'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function notice$message, array $context = array() ) {
        
/**
         * Fires when a `notice` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/notice'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function info$message, array $context = array() ) {
        
/**
         * Fires when an `info` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/info'$message$context );
    }

    
/**
     * @param string $message
     * @param array<string, mixed> $context
     * @return void
     */
    
public static function debug$message, array $context = array() ) {
        
/**
         * Fires when a `debug` level message is logged.
         *
         * @since 3.1.0
         *
         * @param mixed $message The message or data to log.
         * @param array $context The context passed.
         */
        
do_action'qm/debug'$message$context );
    }

    
/**
     * @param mixed $assertion
     * @param string $message
     * @param ?mixed $value
     * @return void
     */
    
public static function assert$assertionstring $message ''$value null ) {
        
/**
         * Fires when an assertion is performed.
         *
         * @since x.y.z
         *
         * @param mixed  $assertion The assertion result, ideally something that evaluates to true.
         * @param string $message   The assertion message. May be an empty string.
         * @param mixed  $value     Optional. A value to show along with the message when the assertion fails.
         */
        
do_action'qm/assert'$assertion$message$value );
    }

    
/**
     * @param string $level
     * @param string $message
     * @param array<string, mixed> $context
     * @phpstan-param QM_Collector_Logger::* $level
     * @return void
     */
    
public static function log$level$message, array $context = array() ) {
        
/** @var QM_Collector_Logger */
        
$logger QM_Collectors::get'logger' );
        
$logger->log$level$message$context );
    }
}