PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 2.0.3
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v2.0.3
3.5.2 3.5.1 3.5.0 3.4.8 3.4.7 3.4.6 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.5.1 1.1.6 1.1.7 1.1.8 1.1.9 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.4.0 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0 1.5.1 1.5.10 1.5.2 1.5.3 1.5.4 1.5.5 1.5.6 1.5.7 1.5.8 1.5.9 1.6.0 1.6.1 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.6.1 1.6.7 1.7.0 1.7.0.1 1.7.0.2 1.7.0.3 1.7.1 1.7.2 1.7.2.1 1.7.2.2 1.7.3 1.7.4 1.7.5 1.7.5.1 1.7.5.2 1.7.6 1.7.7 1.7.7.1 1.7.7.2 1.7.8 1.7.9 1.8.0 1.8.0.1 1.8.1 1.8.2 1.8.2.1 1.8.2.2 1.8.2.3 1.8.3 1.8.4 1.8.5 1.8.6 1.8.7 1.8.8 1.8.9 1.9.0 1.9.0.1 1.9.1 1.9.2 1.9.3 1.9.4 1.9.4.1 1.9.5 1.9.6 1.9.7 1.9.8 1.9.9 2.0.0 2.0.0.1 2.0.1 2.0.2 2.0.3 2.0.3.1 2.0.4 2.0.4.1 2.0.5 2.0.6 2.0.7 2.0.8 2.0.8.1 2.0.9 3.0.0 3.0.0.1 3.0.1 3.0.2 3.0.3 3.0.3.1 3.0.4 3.0.4.1 3.0.4.2 3.0.5 3.0.5.1 3.0.5.2 3.0.6 3.0.6.1 3.0.7.1 3.0.8 3.0.8.1 3.0.9 3.0.9.1 3.0.9.2 3.0.9.3 3.0.9.4 3.0.9.5 3.1.0 3.1.1 3.1.2 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3.0 3.4.0 3.4.1 3.4.2 3.4.2.1 3.4.3 3.4.4 3.4.5 trunk 1.0 1.0.1 1.0.2 1.0.3
everest-forms / includes / class-evf-log-levels.php
everest-forms / includes Last commit date
abstracts 2 years ago admin 2 years ago elementor 4 years ago export 3 years ago fields 2 years ago interfaces 8 years ago libraries 2 years ago log-handlers 4 years ago shortcodes 2 years ago stats 3 years ago templates 5 years ago class-everest-forms.php 2 years ago class-evf-ajax.php 2 years ago class-evf-autoloader.php 7 years ago class-evf-background-updater.php 7 years ago class-evf-cache-helper.php 6 years ago class-evf-cron.php 3 years ago class-evf-deprecated-action-hooks.php 6 years ago class-evf-deprecated-filter-hooks.php 5 years ago class-evf-emails.php 2 years ago class-evf-fields.php 2 years ago class-evf-form-block.php 4 years ago class-evf-form-handler.php 3 years ago class-evf-form-task.php 2 years ago class-evf-forms-features.php 2 years ago class-evf-frontend-scripts.php 2 years ago class-evf-install.php 2 years ago class-evf-integrations.php 7 years ago class-evf-log-levels.php 8 years ago class-evf-logger.php 5 years ago class-evf-post-types.php 5 years ago class-evf-privacy.php 6 years ago class-evf-session-handler.php 7 years ago class-evf-shortcodes.php 4 years ago class-evf-smart-tags.php 2 years ago class-evf-template-loader.php 2 years ago class-evf-validation.php 6 years ago evf-conditional-functions.php 6 years ago evf-core-functions.php 2 years ago evf-deprecated-functions.php 6 years ago evf-entry-functions.php 3 years ago evf-formatting-functions.php 4 years ago evf-notice-functions.php 4 years ago evf-template-functions.php 4 years ago evf-template-hooks.php 7 years ago evf-update-functions.php 5 years ago
class-evf-log-levels.php
113 lines
1 <?php
2 /**
3 * Standard log levels
4 *
5 * @version 1.0.0
6 * @package EverestForms/Classes
7 */
8
9 defined( 'ABSPATH' ) || exit;
10
11 /**
12 * Log levels class.
13 */
14 abstract class EVF_Log_Levels {
15
16 /**
17 * Log Levels
18 *
19 * Description of levels:
20 * 'emergency': System is unusable.
21 * 'alert': Action must be taken immediately.
22 * 'critical': Critical conditions.
23 * 'error': Error conditions.
24 * 'warning': Warning conditions.
25 * 'notice': Normal but significant condition.
26 * 'info': Informational messages.
27 * 'debug': Debug-level messages.
28 *
29 * @see @link {https://tools.ietf.org/html/rfc5424}
30 */
31 const EMERGENCY = 'emergency';
32 const ALERT = 'alert';
33 const CRITICAL = 'critical';
34 const ERROR = 'error';
35 const WARNING = 'warning';
36 const NOTICE = 'notice';
37 const INFO = 'info';
38 const DEBUG = 'debug';
39
40 /**
41 * Level strings mapped to integer severity.
42 *
43 * @var array
44 */
45 protected static $level_to_severity = array(
46 self::EMERGENCY => 800,
47 self::ALERT => 700,
48 self::CRITICAL => 600,
49 self::ERROR => 500,
50 self::WARNING => 400,
51 self::NOTICE => 300,
52 self::INFO => 200,
53 self::DEBUG => 100,
54 );
55
56 /**
57 * Severity integers mapped to level strings.
58 *
59 * This is the inverse of $level_severity.
60 *
61 * @var array
62 */
63 protected static $severity_to_level = array(
64 800 => self::EMERGENCY,
65 700 => self::ALERT,
66 600 => self::CRITICAL,
67 500 => self::ERROR,
68 400 => self::WARNING,
69 300 => self::NOTICE,
70 200 => self::INFO,
71 100 => self::DEBUG,
72 );
73
74 /**
75 * Validate a level string.
76 *
77 * @param string $level Log level.
78 * @return bool True if $level is a valid level.
79 */
80 public static function is_valid_level( $level ) {
81 return array_key_exists( strtolower( $level ), self::$level_to_severity );
82 }
83
84 /**
85 * Translate level string to integer.
86 *
87 * @param string $level Log level, options: emergency|alert|critical|error|warning|notice|info|debug.
88 * @return int 100 (debug) - 800 (emergency) or 0 if not recognized
89 */
90 public static function get_level_severity( $level ) {
91 if ( self::is_valid_level( $level ) ) {
92 $severity = self::$level_to_severity[ strtolower( $level ) ];
93 } else {
94 $severity = 0;
95 }
96 return $severity;
97 }
98
99 /**
100 * Translate severity integer to level string.
101 *
102 * @param int $severity Serevity level.
103 * @return bool|string False if not recognized. Otherwise string representation of level.
104 */
105 public static function get_severity_level( $severity ) {
106 if ( array_key_exists( $severity, self::$severity_to_level ) ) {
107 return self::$severity_to_level[ $severity ];
108 } else {
109 return false;
110 }
111 }
112 }
113