if (dlevel)
{
short num = 0;
- if ((mutt_str_atos(dlevel, &num) < 0) || (num < LL_MESSAGE) || (num > LL_DEBUG5))
+ if ((mutt_str_atos(dlevel, &num) < 0) || (num < LL_MESSAGE) || (num >= LL_MAX))
{
mutt_error(_("Error: value '%s' is invalid for -d"), dlevel);
goto main_exit; // TEST07: neomutt -d xyz
* @retval 0 Success
* @retval -1 Error, level is out of range
*
- * The level can be between 0 and LL_DEBUG5.
+ * The level should be: LL_MESSAGE <= level < LL_MAX.
*/
int log_file_set_level(int level, bool verbose)
{
- if ((level < 0) || (level > 5))
+ if ((level < LL_MESSAGE) || (level >= LL_MAX))
return -1;
if (level == LogFileLevel)
LogFileLevel = level;
- if (level == 0)
+ if (level == LL_MESSAGE)
{
log_file_close(verbose);
}
log_file_open(verbose);
}
- if (LogFileLevel == LL_DEBUG5)
+ if (LogFileLevel >= LL_DEBUG5)
{
fprintf(LogFileFP,
"\n"
LL_DEBUG3 = 3, ///< Log at debug level 3
LL_DEBUG4 = 4, ///< Log at debug level 4
LL_DEBUG5 = 5, ///< Log at debug level 5
+
+ LL_MAX,
};
/**
int level_validator(const struct ConfigSet *cs, const struct ConfigDef *cdef,
intptr_t value, struct Buffer *err)
{
- if ((value < 0) || (value > LL_DEBUG5))
+ if ((value < 0) || (value >= LL_MAX))
{
mutt_buffer_printf(err, _("Invalid value for option %s: %ld"), cdef->name, value);
return CSR_ERR_INVALID;