Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output bee_messages as text rather than table #414

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 9 additions & 16 deletions includes/render.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ function bee_print_messages() {
return;
}

// Add a new line before starting.
echo "\n";

// Style each type of message differently.
foreach ($_bee_messages as $type => $type_messages) {
// Skip 'log' messages if `debug` mode is disabled.
Expand All @@ -24,27 +27,17 @@ function bee_print_messages() {

list($symbol, $color) = bee_message_type_info($type);

// Prepare `$rows` array for table output.
// Output the symbol and text for each message.
foreach ($type_messages as $message) {
$rows[] = array(
array(
'value' => $symbol,
'#color' => $color,
'#bold' => TRUE,
),
array('value' => $message),
);
echo bee_format_text(" $symbol", $color) . " $message";

// Add a newline after each message.
echo "\n";
}
}

// Render messages in a table.
// Add a new line after the messages.
echo "\n";
bee_render_table(array(
'rows' => $rows,
'delimiter' => ' ',
'delimiter_left' => ' ',
'delimiter_right' => ' ',
));
}

/**
Expand Down
Loading