PluginProbe
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO / 1.4.14
Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO v1.4.14
1.4.14 1.4.13 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 1.4.6 1.4.5 1.4.4 1.4.3 1.4.2 1.4.1 1.4.0 1.3.54 1.3.53 1.3.52 1.3.51 1.3.50 1.3.49 1.3.48 1.3.47 1.3.46 1.3.45 All 177 releases
disco / app / Utility / Log.php

Log.php in Discount Rules for WooCommerce – Disco | Dynamic Pricing, Conditions, Bulk, Bundle, BOGO 1.4.14, at app/Utility/Log.php

52 lines 1017 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Log.php
4 *
5 * @package CTXFeed
6 * @subpackage Disco\App\Utility
7 */
8
9 namespace Disco\App\Utility;
10
11 use WC_Logger;
12
13 /**
14 * Class Log
15 *
16 * @package CTXFeed
17 * @subpackage Disco\App\Utility
18 * @author Ohidul Islam <wahid0003@gmail.com>
19 * @link https://webappick.com
20 * @license https://opensource.org/licenses/gpl-license.php GNU Public License
21 * @category MyCategory
22 */
23 class Log {
24
25 /**
26 * Write log to WooCommerce log file.
27 *
28 * @param string $message Message to write to log.
29 * @param string $type Type of log.
30 * @return void
31 */
32 public static function write( $message, $type = 'info' ) {
33 if ( ! class_exists( 'WC_Logger' ) ) {
34 return;
35 }
36
37 $handle = DISCO_TEXTDOMAIN;
38 $log = new WC_Logger( array( $handle ) );
39
40 if ( $type === 'error' ) {
41 $log->error( $message );
42 } elseif ( $type === 'warning' ) {
43 $log->warning( $message );
44 } elseif ( $type === 'info' ) {
45 $log->info( $message );
46 } else {
47 $log->add( $handle, $message );
48 }
49 }
50
51 }
52