Patch to default to storage log rather than display an error

Wrote new code? Fixed a bug? Want to discuss technical stuff? Feel free to post it here.

Moderator: Moderators

Message
Author
sli
Perl Monk
Perl Monk
Posts: 810
Joined: 04 Apr 2008, 17:26
Noob?: No

Patch to default to storage log rather than display an error

#1 Post by sli »

In Misc.pm, at line 162, add readStorageLog after writeStorageLog.

Again, in Misc.pm around line 3157 or so, add:

Code: Select all

sub readStorageLog {
	my ($show_error_on_fail) = @_;
	my $f;
	my @storageLog;

	if (open($f, "<:utf8", $Settings::storage_log_file)) {
		@storageLog = <$f>;
		foreach (@storageLog) {
			print "$_";
		}
	} elsif ($show_error_on_fail) {
		error TF("Unable to read from %s\n", $Settings::storage_log_file);
	}
}
In Commands.pm, comment out or remove the error at line 4526 and insert this:

Code: Select all

readStorageLog(1);
Done. The output isn't as comprehensive as the standard storage command, but it'll do. Really wish you guys were using Git so I could just issue a pull request.
cs : ee : realist