Automattic\WooCommerce\Internal\Admin\Logging\FileV2

FileController::generate_filenameprivateWC 1.0

Generate the full name of a file based on source and date values.

Method of the class: FileController{}

No Hooks.

Returns

String.

Usage

// private - for code of main (parent) class only
$result = $this->generate_filename( $source, $time ): string;
$source(string) (required)
The source property of a log entry, which determines the filename.
$time(int) (required)
The time of the log entry as a Unix timestamp.

FileController::generate_filename() code WC 9.9.5

private function generate_filename( string $source, int $time ): string {
	$file_id = File::generate_file_id( $source, null, $time );
	$hash    = File::generate_hash( $file_id );

	return "$file_id-$hash.log";
}