Skip to content

Commit

Permalink
opal-prd: interpret log level prefixes from HBRT
Browse files Browse the repository at this point in the history
Interpret the (optional) *_MRK log prefixes on HBRT messages, and set
the syslog log priority to suit.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
  • Loading branch information
jk-ozlabs authored and stewartsmith committed Jun 6, 2017
1 parent 98d32d5 commit 20585ee
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion external/opal-prd/opal-prd.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,25 @@ extern int call_run_command(int argc, const char **argv, char **o_outString);

void hservice_puts(const char *str)
{
pr_log(LOG_INFO, "HBRT: %s", str);
int priority = LOG_INFO;

/* Interpret the 2-character ERR_MRK/FAIL_MRK/WARN_MRK prefixes that
* may be present on HBRT log messages, and bump the log priority as
* appropriate.
*/
if (strlen(str) >= 2 && str[1] == '>') {
switch (str[0]) {
case 'E':
case 'F':
priority = LOG_ERR;
break;
case 'W':
priority = LOG_WARNING;
break;
}
}

pr_log(priority, "HBRT: %s", str);
}

void hservice_assert(void)
Expand Down

0 comments on commit 20585ee

Please sign in to comment.