DVLogConfig class final

Logging as a project declares it.

dartvel:
  logging:
    level: info          # the floor for every destination
    native: true         # logcat, the unified log, journald, the console
    file:                # the device's own log; `file: false` keeps none
      maxBytes: 1048576
      files: 2
      retentionDays: 7
    ship:                # off unless declared
      enabled: true
      level: warn        # warn, error or fatal
      batch: 50
      perInstallPerHour: 600
      maxBytes: 262144

Read strictly, for the reason dartvel.crashes is: every setting has a default, so a misspelt key or a string where a number belongs would be replaced by the default and look exactly like a setting that was honoured. Each is refused, naming the key.

Constructors

DVLogConfig({DVLogLevel level = DVLogLevel.info, bool native = true, bool file = true, int fileMaxBytes = 1024 * 1024, int fileCount = 2, Duration fileRetention = const Duration(days: 7), bool ship = false, DVLogLevel shipLevel = DVLogLevel.warn, int shipBatch = 50, int ingestPerInstallPerHour = 600, int ingestMaxBytes = 262144})
const
DVLogConfig.parse(Object? section)
Reads the dartvel.logging section, or the defaults when there is none.
factory

Properties

file → bool
Whether the device keeps a log file.
final
fileCount → int
final
fileMaxBytes → int
final
fileRetention → Duration
final
hashCode → int
The hash code for this object.
no setterinherited
ingestMaxBytes → int
The largest batch body the backend accepts.
final
ingestPerInstallPerHour → int
Records the backend accepts from one install per hour; past it they are counted.
final
level → DVLogLevel
Records below this go nowhere, on any destination.
final
native → bool
Whether records are mirrored to the platform's own log.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
ship → bool
Whether a device sends its records to the application's backend.
final
shipBatch → int
Records per request.
final
shipLevel → DVLogLevel
The lowest level sent. Never below warn: debug and info from every device in a fleet is a cost and a privacy problem, and the records worth having from a device someone else holds are the ones saying something went wrong.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDeclaration() → Map<String, Object?>
The section as parse reads it, for the generated runtime to embed.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

fileSettings → const List<String>
settings → const List<String>
shipSettings → const List<String>