Skip to content

Releases: Tastyep/structlog.nvim

0.2

08 Jan 14:03
Compare
Choose a tag to compare

Design and extensibility improvements

This release contains a set of improvements based on feedback I received from structlog's users (Thank you again !).
It builds on the previous one to make it more user-friendly and easier to extend. I expect the API to be stable which would pave the way to finally releasing the 1.0 version of structlog !

Additionally, with the release of nvim 0.8, colors are finally displayed when looking at the message's history (:message). This is a good thing for structlog as it will allow defining more colors and improve the overall visual output.

demo

Features

  • Define the pipeline object
    The log modification logic has been moved from the sink to the pipeline object. The pipeline is an encapsulation of log modifiers and a destination sink.
  • Make the logging level configurable at the pipeline level.
    This allows filtering out logs from some pipelines based on logging level. For example, a user might want to log everything to a file, but not create a notification message for each trace log.
  • Provide a sink adapter.
    This adapter allows the user to inject a custom log writer into a sink object. This can be considered as a sink interface using composition instead of inheritance. The NvimNotify sink is now based on this adapter.

Improvements

  • Add a blacklist option to the formatters.
    The blacklist option allows discarding log entries. For instance, this can be used to eliminate the logger_name attribute that is now part of the logger context.
  • More testing and documentation improvements.
    While it is a bit difficult to estimate the coverage due to the lack of solution for computing it, structlog should have a > 90% test coverage.

Bug Fixes

  • Make it possible to create non-asynchronous console sinks.

0.1

24 Aug 12:57
Compare
Choose a tag to compare
0.1

Structured Logging

This first release defines what structlog should be and what its API should look like.

Features

Sinks

  • Console: Write log entries to nvim's console.
  • File: Write log entries to a file.
  • RotatingFile: Write log entries to a rotating file.

Processors

  • Namer: Add the logger name into log entries as 'logger_name'.
  • StackWriter: Read the stack trace and provide additional log entries ["file", "line"].
  • Timestamper: Add a 'timestamp' entry to the log entries.

Formatters

  • Format: Format entries using a string format.
  • FormatColorizer: Format and Colorize log entries.
    The FormatColorizer only works with the Console sink.

Other

  • Global log management structlog's configure(...) method
  • Most of the code base is tested
  • The documentation is generated from code thanks to LDoc