Changeset f92b315 in mainline


Ignore:
Timestamp:
2019-08-17T13:58:13Z (5 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
Children:
241f1985
Parents:
8d74fdd
git-author:
Michal Koutny <xm.koutny+hos@…> (2016-02-07 22:30:40)
git-committer:
Matthieu Riolo <matthieu.riolo@…> (2019-08-17 13:58:13)
Message:

sysman: Throttled logging to LVL_NOTE

Location:
uspace/srv/sysman
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/sysman/log.c

    r8d74fdd rf92b315  
    3737
    3838static FILE *log_file = NULL;
     39static log_level_t max_level = LVL_NOTE;
     40
     41extern void sysman_log_init(log_level_t level)
     42{
     43        max_level = level;
     44}
    3945
    4046void sysman_log(log_level_t level, const char *fmt, ...)
    4147{
     48        if (level > max_level) {
     49                return;
     50        }
    4251        va_list args;
    4352        va_start(args, fmt);
  • uspace/srv/sysman/log.h

    r8d74fdd rf92b315  
    3333#include <stdio.h>
    3434
     35extern void sysman_log_init(log_level_t);
     36
    3537/*
    3638 * Temporarily use only simple printfs, later add some smart logging,
  • uspace/srv/sysman/unit.c

    r8d74fdd rf92b315  
    137137int unit_start(unit_t *unit)
    138138{
    139         sysman_log(LVL_DEBUG, "%s('%s')", __func__, unit_name(unit));
     139        sysman_log(LVL_NOTE, "%s('%s')", __func__, unit_name(unit));
    140140        return UNIT_VMT(unit)->start(unit);
    141141}
     
    147147int unit_stop(unit_t *unit)
    148148{
    149         sysman_log(LVL_DEBUG, "%s('%s')", __func__, unit_name(unit));
     149        sysman_log(LVL_NOTE, "%s('%s')", __func__, unit_name(unit));
    150150        return UNIT_VMT(unit)->stop(unit);
    151151}
     
    153153void unit_exposee_created(unit_t *unit)
    154154{
    155         sysman_log(LVL_DEBUG, "%s('%s')", __func__, unit_name(unit));
     155        sysman_log(LVL_DEBUG2, "%s('%s')", __func__, unit_name(unit));
    156156        return UNIT_VMT(unit)->exposee_created(unit);
    157157}
     
    159159void unit_fail(unit_t *unit)
    160160{
    161         sysman_log(LVL_DEBUG, "%s('%s')", __func__, unit_name(unit));
     161        sysman_log(LVL_WARN, "%s('%s')", __func__, unit_name(unit));
    162162        return UNIT_VMT(unit)->fail(unit);
    163163}
Note: See TracChangeset for help on using the changeset viewer.