PluginProbe ʕ •ᴥ•ʔ
Pods – Custom Content Types and Fields / 2.8.23.4
Pods – Custom Content Types and Fields v2.8.23.4
2.7.31.4 2.8.23.5 2.9.19.5 3.0.10.5 3.1.4.3 3.2.8.4 3.3.9.2 2.8.23.4 2.9.19.4 3.0.10.4 3.1.4.2 3.2.8.3 3.3.9.1 trunk 1.14.8 2.7.31.3 2.8.23.3 2.9.19.3 3.0.10.3 3.1.4.1 3.2.0 3.2.1 3.2.1.1 3.2.2 3.2.4 3.2.5 3.2.6 3.2.7 3.2.7.1 3.2.8 3.2.8.1 3.2.8.2 3.3.0 3.3.1 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.3.8 3.3.9
pods / tribe-common / src / Tribe / Log / Null_Logger.php
pods / tribe-common / src / Tribe / Log Last commit date
Action_Logger.php 2 weeks ago Admin.php 2 weeks ago Canonical_Formatter.php 2 weeks ago File_Logger.php 2 weeks ago Logger.php 2 weeks ago Monolog_Logger.php 2 weeks ago Null_Logger.php 2 weeks ago Service_Provider.php 2 weeks ago
Null_Logger.php
107 lines
1 <?php
2
3
4 /**
5 * Class Null_Logger
6 *
7 * Logs nothing, reads nothing.
8 */
9 class Tribe__Log__Null_Logger implements Tribe__Log__Logger {
10
11 /**
12 * Indicates if the logger will work in the current environment.
13 *
14 * @return bool
15 */
16 public function is_available() {
17 return true;
18 }
19
20 /**
21 * Returns a 'human friendly' name for the logging implementation.
22 *
23 * @return string
24 */
25 public function get_name() {
26 return __( 'Null logger (will log nothing)', 'tribe-common' );
27 }
28
29 /**
30 * Responsible for commiting the entry to the log (but only if the debug level
31 * is appropriate).
32 *
33 * @param string $entry
34 * @param string $type
35 * @param string $src
36 */
37 public function log( $entry, $type = Tribe__Log::DEBUG, $src = '' ) {
38 // no-op
39 }
40
41 /**
42 * Retrieve up to $limit most recent log entries in reverse chronological
43 * order. If $limit is a negative or zero value, there is no limit.
44 *
45 * Implementation-specific arguments can optionally be provided as a second
46 * parameter. This may include support for a 'log' param where an identifer
47 * obtained via the list_availalbe_logs() method is passed in order to query
48 * a specific archived log.
49 *
50 * @see Tribe__Log__Logger::list_available_logs()
51 *
52 * @param int $limit
53 * @param array $args
54 *
55 * @return array
56 */
57 public function retrieve( $limit = 0, array $args = [] ) {
58 return [];
59 }
60
61 /**
62 * Returns a list of currently accessible logs (current first, oldest last).
63 *
64 * This can be useful if, for instance, a particular logger organizes logging
65 * by dates and keeps an archive of upto 1 week's worth of logs - in which case
66 * the array might look like:
67 *
68 * [ '2016-12-31',
69 * '2016-12-30',
70 * '2016-12-30',
71 * '2016-12-30',
72 * '2016-12-30', ... ]
73 *
74 * Note that a) the array may be empty and b) it won't necessarily contain
75 * date strings, it could contain identifiers like 'current', 'prev', 'prev2'
76 * or really anything the logging engine prefers.
77 *
78 * @return array
79 */
80 public function list_available_logs() {
81 return [];
82 }
83
84 /**
85 * Switches to the specified log.
86 *
87 * If optional param $create is true the logger will try to create a new log
88 * using the provided identifier if it doesn't already exist.
89 *
90 * @param mixed $log_identifier
91 * @param bool $create
92 *
93 * @return bool
94 */
95 public function use_log( $log_identifier, $create = false ) {
96 // no-op
97 }
98
99 /**
100 * Performs routine maintenance and cleanup work (such as log rotation)
101 * whenever it is called.
102 */
103 public function cleanup() {
104 // no-op
105 }
106 }
107