PluginProbe ʕ •ᴥ•ʔ
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI / 3.5.2
Everest Forms – Contact Form, Payment Form, Quiz, Survey & Custom Form Builder with AI v3.5.2
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 / abstracts / class-evf-log-handler.php
everest-forms / includes / abstracts Last commit date
legacy 6 years ago class-evf-background-process.php 7 years ago class-evf-deprecated-hooks.php 2 months ago class-evf-form-fields-upload.php 1 week ago class-evf-form-fields.php 4 weeks ago class-evf-integration.php 5 years ago class-evf-log-handler.php 6 years ago class-evf-session.php 1 year ago class-evf-settings-api.php 4 years ago
class-evf-log-handler.php
54 lines
1 <?php
2 /**
3 * Log handling functionality.
4 *
5 * @package EverestForms\Abstracts
6 * @since 1.0.0
7 */
8
9 defined( 'ABSPATH' ) || exit;
10
11 /**
12 * Abstract EVF Log Handler Class
13 */
14 abstract class EVF_Log_Handler implements EVF_Log_Handler_Interface {
15
16 /**
17 * Formats a timestamp for use in log messages.
18 *
19 * @param int $timestamp Log timestamp.
20 *
21 * @return string Formatted time for use in log entry.
22 */
23 protected static function format_time( $timestamp ) {
24 return date( 'c', $timestamp ); // phpcs:ignore WordPress.DateTime.RestrictedFunctions
25 }
26
27 /**
28 * Builds a log entry text from level, timestamp and message.
29 *
30 * @param int $timestamp Log timestamp.
31 * @param string $level emergency|alert|critical|error|warning|notice|info|debug.
32 * @param string $message Log message.
33 * @param array $context Additional information for log handlers.
34 *
35 * @return string Formatted log entry.
36 */
37 protected static function format_entry( $timestamp, $level, $message, $context ) {
38 $time_string = self::format_time( $timestamp );
39 $level_string = strtoupper( $level );
40 $entry = "{$time_string} {$level_string} {$message}";
41
42 return apply_filters(
43 'everest_forms_format_log_entry',
44 $entry,
45 array(
46 'timestamp' => $timestamp,
47 'level' => $level,
48 'message' => $message,
49 'context' => $context,
50 )
51 );
52 }
53 }
54