# elementor/4.2.4/modules/wp-cli/cli-logger.php

Elementor Website Builder – more than just a page builder, version 4.2.4. 30 lines.

- Page: https://pluginprobe.com/plugins/elementor/4.2.4/code/modules/wp-cli/cli-logger.php
- Raw: https://pluginprobe.com/plugins/elementor/4.2.4/raw/modules/wp-cli/cli-logger.php
- Modified: 2025-03-17T13:28:54+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/elementor/4.2.4/code/modules/wp-cli/cli-logger.php#L10-L20`.

```php
<?php
namespace Elementor\Modules\WpCli;

use Elementor\Core\Logger\Loggers\Db;
use Elementor\Core\Logger\Items\Log_Item_Interface;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

class Cli_Logger extends Db {

	public function save_log( Log_Item_Interface $item ) {
		$message = $item->format( 'raw' );
		switch ( $item->type ) {
			case self::LEVEL_WARNING:
				\WP_CLI::warning( $message );
				break;
			case self::LEVEL_ERROR:
				\WP_CLI::error( $message, false );
				break;
			default:
				\WP_CLI::log( $message );
				break;
		}

		parent::save_log( $item );
	}
}

```
