diff --git a/lib/activate/fs.c b/lib/activate/fs.c index 883935349..1071a3678 100644 --- a/lib/activate/fs.c +++ b/lib/activate/fs.c @@ -46,7 +46,8 @@ static int _rm_dir(struct volume_group *vg) if (!build_vg_path(vg_path, sizeof(vg_path), vg->cmd->dev_dir, vg->name)) { - log_err("Couldn't remove volume group directory."); + log_error("Couldn't construct name of volume group dir for %s", + vg->name); return 0; } @@ -62,16 +63,16 @@ static int _mk_link(struct logical_volume *lv) struct stat buf; if (!build_dm_path(lv_path, sizeof(lv_path), lv->vg->name, lv->name)) { - log_err("Couldn't create destination path for " - "logical volume link."); + log_error("Couldn't create destination pathname for " + "logical volume link for %s", lv->name); return 0; } if (!build_lv_link_path(link_path, sizeof(link_path), lv->vg->cmd->dev_dir, lv->vg->name, lv->name)) { - log_err("Couldn't create source path for " - "logical volume link."); + log_error("Couldn't create source pathname for " + "logical volume link %s", lv->name); return 0; } @@ -107,7 +108,7 @@ static int _rm_link(struct logical_volume *lv, const char *lv_name) if (!build_lv_link_path(link_path, sizeof(link_path), lv->vg->cmd->dev_dir, lv->vg->name, lv->name)) { - log_err("Couldn't create link path (in order to remove it."); + log_error("Couldn't determine link pathname."); return 0; } diff --git a/lib/config/config.c b/lib/config/config.c index 9100ffcc1..8128b7947 100644 --- a/lib/config/config.c +++ b/lib/config/config.c @@ -554,12 +554,12 @@ find_config_str(struct config_node *cn, struct config_node *n = find_config_node(cn, path, sep); if (n && n->v->type == CFG_STRING) { - log_debug("Setting %s to %s", path, n->v->v.str); + log_very_verbose("Setting %s to %s", path, n->v->v.str); return n->v->v.str; } if (fail) - log_debug("%s not found in config: defaulting to %s", + log_very_verbose("%s not found in config: defaulting to %s", path, fail); return fail; } @@ -570,11 +570,12 @@ int find_config_int(struct config_node *cn, const char *path, struct config_node *n = find_config_node(cn, path, sep); if (n && n->v->type == CFG_INT) { - log_debug("Setting %s to %d", path, n->v->v.i); + log_very_verbose("Setting %s to %d", path, n->v->v.i); return n->v->v.i; } - log_debug("%s not found in config: defaulting to %d", path, fail); + log_very_verbose("%s not found in config: defaulting to %d", + path, fail); return fail; } @@ -584,11 +585,11 @@ float find_config_float(struct config_node *cn, const char *path, struct config_node *n = find_config_node(cn, path, sep); if (n && n->v->type == CFG_FLOAT) { - log_debug("Setting %s to %f", path, n->v->v.r); + log_very_verbose("Setting %s to %f", path, n->v->v.r); return n->v->v.r; } - log_debug("%s not found in config: defaulting to %f", + log_very_verbose("%s not found in config: defaulting to %f", path, fail); return fail; diff --git a/lib/format1/disk-rep.c b/lib/format1/disk-rep.c index f22701317..8f1539331 100644 --- a/lib/format1/disk-rep.c +++ b/lib/format1/disk-rep.c @@ -134,7 +134,8 @@ static int _munge_formats(struct pv_disk *pvd) int read_pvd(struct device *dev, struct pv_disk *pvd) { if (dev_read(dev, 0, sizeof(*pvd), pvd) != sizeof(*pvd)) { - log_debug("Failed to read PV data from %s", dev_name(dev)); + log_very_verbose("Failed to read PV data from %s", + dev_name(dev)); return 0; } @@ -350,12 +351,13 @@ static void _add_pv_to_list(struct list *head, struct disk_list *data) if (!strncmp(data->pvd.pv_uuid, pvd->pv_uuid, sizeof(pvd->pv_uuid))) { if (MAJOR(data->dev->dev) != md_major()) { - log_debug("Ignoring duplicate PV %s on %s", - pvd->pv_uuid, dev_name(data->dev)); + log_very_verbose("Ignoring duplicate PV %s on " + "%s", pvd->pv_uuid, + dev_name(data->dev)); return; } - log_debug("Duplicate PV %s - using md %s", - pvd->pv_uuid, dev_name(data->dev)); + log_very_verbose("Duplicate PV %s - using md %s", + pvd->pv_uuid, dev_name(data->dev)); list_del(pvdh); break; } @@ -596,7 +598,8 @@ int write_disks(struct list *pvs) if (!(_write_all_pvd(dl))) fail; - log_debug("Successfully wrote data to %s", dev_name(dl->dev)); + log_very_verbose("Successfully wrote data to %s", + dev_name(dl->dev)); } return 1; diff --git a/lib/format1/format1.c b/lib/format1/format1.c index e9b410f15..f65be783c 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -29,8 +29,8 @@ static int _check_vgs(struct list *pvs) first = dl; else if (memcmp(&first->vgd, &dl->vgd, sizeof(first->vgd))) { - log_err("VG data differs between PVs %s and %s", - dev_name(first->dev), dev_name(dl->dev)); + log_error("VG data differs between PVs %s and %s", + dev_name(first->dev), dev_name(dl->dev)); return 0; } pv_count++; @@ -359,8 +359,8 @@ static int _pv_setup(struct format_instance *fi, struct physical_volume *pv, static int _lv_setup(struct format_instance *fi, struct logical_volume *lv) { if (lv->le_count > MAX_LE_TOTAL) { - log_err("Format 1 logical volumes cannot contain more than " - "%d extents.", MAX_LE_TOTAL); + log_error("logical volumes cannot contain more than " + "%d extents.", MAX_LE_TOTAL); return 0; } diff --git a/lib/format_text/export.c b/lib/format_text/export.c index 2b3393ede..10045a213 100644 --- a/lib/format_text/export.c +++ b/lib/format_text/export.c @@ -55,7 +55,7 @@ static void _inc_indent(struct formatter *f) static void _dec_indent(struct formatter *f) { if (!f->indent--) { - log_debug("Indenting seems to have messed up\n"); + log_error("Internal error tracking indentation"); f->indent = 0; } } diff --git a/lib/log/log.h b/lib/log/log.h index a394f5400..ac25974b4 100644 --- a/lib/log/log.h +++ b/lib/log/log.h @@ -70,7 +70,7 @@ void print_log(int level, const char *file, int line, const char *format, ...) #define log_err(x...) plog(_LOG_ERR, x) #define log_fatal(x...) plog(_LOG_FATAL, x) -#define stack log_debug( "s" ) +#define stack log_debug( "s" ) /* Backtrace on error */ #define log_error(fmt, args...) log_err(fmt , ## args) #define log_print(fmt, args...) log_warn(fmt , ## args) diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 313fbba40..88c40ebf7 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -66,7 +66,7 @@ int _add_pv_to_vg(struct format_instance *fi, struct volume_group *vg, pv->pe_allocated = 0; if (!fi->ops->pv_setup(fi, pv, vg)) { - log_debug("Format-specific setup of physical volume '%s' " + log_error("Format-specific setup of physical volume '%s' " "failed.", pv_name); return 0; } diff --git a/lib/mm/pool-fast.c b/lib/mm/pool-fast.c index 4698de473..a12b2ee9f 100644 --- a/lib/mm/pool-fast.c +++ b/lib/mm/pool-fast.c @@ -125,8 +125,8 @@ void pool_free(struct pool *p, void *ptr) } if (!c) - log_debug("pool_free asked to free a pointer " - "that wasn't in the pool, doing nothing"); + log_error("Internal error: pool_free asked to free pointer " + "not in pool"); else p->chunk = c; } diff --git a/lib/regex/matcher.c b/lib/regex/matcher.c index 9fc5e47a3..95f7765fe 100644 --- a/lib/regex/matcher.c +++ b/lib/regex/matcher.c @@ -128,7 +128,7 @@ static void _calc_functions(struct matcher *m) break; default: - log_debug("unknown node type"); + log_error("Internal error: Unknown calc node type"); } /* @@ -301,7 +301,7 @@ struct matcher *matcher_create(struct pool *mem, /* parse this expression */ if(!(rx = rx_parse_tok(scratch, all, ptr))) { - log_debug("Couldn't parse the regex"); + log_error("Couldn't parse regex"); goto bad; } diff --git a/lib/regex/parse_rx.c b/lib/regex/parse_rx.c index 53f023b54..57e2c4c88 100644 --- a/lib/regex/parse_rx.c +++ b/lib/regex/parse_rx.c @@ -70,7 +70,7 @@ static int _get_token(struct parse_sp *ps) range = 1; ptr++; if(ptr == ps->rx_end) { - log_info("incomplete charset " + log_error("Incomplete range" "specification"); return -1; } @@ -142,8 +142,8 @@ static int _get_token(struct parse_sp *ps) /* escaped character */ ptr++; if(ptr >= ps->rx_end) { - log_info("badly quoted character at end " - "of expression"); + log_error("Badly quoted character at end " + "of expression"); ps->type = -1; return -1; } @@ -210,7 +210,7 @@ static struct rx_node *_term(struct parse_sp *ps) _get_token(ps); /* match '(' */ n = _or_term(ps); if(ps->type != ')') { - log_debug("missing ')' in regular expression"); + log_error("missing ')' in regular expression"); return 0; } _get_token(ps); /* match ')' */ @@ -292,7 +292,7 @@ static struct rx_node *_or_term(struct parse_sp *ps) _get_token(ps); /* match '|' */ if (!(r = _or_term(ps))) { - log_info("badly formed 'or' expression"); + log_error("Badly formed 'or' expression"); return NULL; } @@ -320,7 +320,7 @@ struct rx_node *rx_parse_tok(struct pool *mem, _get_token(ps); /* load the first token */ if (!(r = _or_term(ps))) { - log_err("parse error in regex"); + log_error("Parse error in regex"); pool_free(mem, ps); } diff --git a/tools/vgscan.c b/tools/vgscan.c index 97a328e36..a60243b39 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -35,7 +35,7 @@ int vgscan(int argc, char **argv) log_verbose("Wiping internal cache of PVs in VGs"); vgcache_destroy(); - log_print("Reading all physical volumes (this may take a while...)"); + log_print("Reading all physical volumes. This may take a while..."); return process_each_vg(argc, argv, &vgscan_single); }