summaryrefslogtreecommitdiff
blob: c07fd733a41fca214d78192fc3e410e8ed015fad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
// In the future, this will log to the database and require a build ID, but for now it just prints
function log_msg($msg, $nl=true) {
	echo $msg.($nl?"\n":'');
}
function log_status($msg, $result) {
	log_msg($msg."... ".($result?color('[success]', 'green'):color('[failure]', 'red')));
	return $result;
}
function color($msg, $color) {
	$r="\033[0m";
	switch(strtolower($color)) {
	case 'red':
		return "\033[31m$msg$r";
	case 'green':
		return "\033[32m$msg$r";
	}
}
function indent($msg, $tabs=1) {
	return str_replace("\n", "\n".str_repeat("\t", $tabs), $msg);
}
?>