/dlog

NLog-inspired logging library for Dart and Flutter

Primary LanguageDart

TODO

  • Colored Console

    • Parse conditions
    • evaluate conditions
    • figure out discrepency between HIghlightRowRUles and _highlightRowRles
    • system logger
  • impl File target

  • fix bug in layout parser that ignores whitespace in text literals

  • make Layout defintions recursive

Mandatory goals

  • implement FileTarget's archival and rotation semantics
  • implement JsonTarget
  • more layout renderers
  • prove implementation of ILogger
  • setup TargetWithLayoutHeaderFooter
  • setup TargetWithLayout
  • change current targets to implement LHF
  • set LFH.closeTarget() to write footer
  • set LFH.initialize() to write header

Stretch goals

  • implement programatic construction of loggers and log configurations
  • implement runtime reload => trickle down to each logger and layout to reparse its settings

Targets

Implemented

Not Yet Implemented

Will Not Implememt

Undecided

Non-Standard May Implement

  • Postgres
  • Sqlite
  • Slack
  • Line

Layouts

Implemented

Not Yet Implememted

  • n/a

Will Not Implement

Undecided

Layout Renderers

Implemented

Not Yet Implemented

Undecided

WIll Not Implement

Non-standard may implemented

  • ${unixtime}

Architecture

This project is based entirely off NLog, and takes major inspiriation from its architecture. Although simplified, much of the underlying systems are laid out in the same manner.

flowchart TD
	z{Rule\nwhat and where} --> t
	t{Target\ntype,name} --> Layout
	Layout --> x{{List LayoutRenderer}}
	Layout --> y{{List Rule}}

Differences from NLog

layouts

  • Strings must be surrounded by single-quotes
    • e.g., ${literal:text=hello} -> ${literal:text='hello'}
  • ASP.NET integrations will not be considered
  • Config file is json based, not xml based. Xml parsing will not be consideed at this time
  • Some layout renderers that are not in NLog are included here. See also: ${unixtime}
  • ${event-property} layout renderer uses JSONPath syntax for nested objects in the objectpath property
  • requred properties must be in key=value form.
    • e.g., ${event-property:item1} is not permitted. Use ${event-property:item=item1} instead