Skip to content

Commit

Permalink
Warning when debug-aspire-update.log doesnt exist (#109)
Browse files Browse the repository at this point in the history
  • Loading branch information
namithj authored Nov 3, 2024
1 parent bb0d77a commit c3ca998
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions includes/class-debug.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,16 @@ public static function log( $message, $type = 'string' ) {

$file_path = WP_CONTENT_DIR . '/' . self::$log_file;

$content = $wp_filesystem->get_contents( $file_path );
if ( false === $content ) {
$wp_filesystem->put_contents(
$file_path,
$formatted_message,
FS_CHMOD_FILE
);
} else {
$wp_filesystem->put_contents(
$file_path,
$content . $formatted_message,
FS_CHMOD_FILE
);
$content = '';
if ( $wp_filesystem->exists( $file_path ) ) {
$content = $wp_filesystem->get_contents( $file_path );
}

$wp_filesystem->put_contents(
$file_path,
$content . $formatted_message,
FS_CHMOD_FILE
);
}

/**
Expand Down

0 comments on commit c3ca998

Please sign in to comment.