Skip to content

logLevelsEnabled can not enable lower than info #90

@JTorkk

Description

@JTorkk

Current if clause in flog.dart line 482 is:

if (LogLevel.values.indexOf(_config.activeLogLevel) <=
                LogLevel.values.indexOf(log.logLevel!) &&
            _config.logLevelsEnabled.contains(_config.activeLogLevel)) {
          //check to see if logcat debugging is enabled
          if (_config.isDebuggable) {
            print(Formatter.format(log, _config));
          }
          await _flogDao.insert(log);
        }

and it should be:

if (LogLevel.values.indexOf(_config.activeLogLevel) <=
                LogLevel.values.indexOf(log.logLevel!) ||
            _config.logLevelsEnabled.contains(_config.activeLogLevel)) {
          //check to see if logcat debugging is enabled
          if (_config.isDebuggable) {
            print(Formatter.format(log, _config));
          }
          await _flogDao.insert(log);
        }

Because currently used operator is && instead of || lower than info logs are never written to db even tho they are enabled in config.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions