PUM_Utils_Logging::truncate_log()

Truncates a log file to maximum of 250 lines.


Description Description


Source Source

File: classes/Utils/Logging.php

	public function truncate_log() {
		$content       = $this->get_file();
		$lines         = explode( "\r\n", $content );
		$lines         = array_slice( $lines, 0, 250 ); //50 is how many lines you want to keep
		$this->content = implode( "\r\n", $lines );
		$this->save_logs();
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.