Skip to content

v0.4.0

Pre-release
Pre-release

Choose a tag to compare

@mostertb mostertb released this 27 Feb 13:24
· 104 commits to master since this release

This release contains a bunch of features that were a result of a refactor of the logging functionality to achieve configuration consistency.

General

  • Errors that are focused at the user of the bundle are now all thrown as the new BaseCommandException
  • [BC] A BaseCommandException is now thrown if the same command object is executed twice. This is a protection mechanism as the configuration and class variables are not reset in between executions and thus unintentionally running the same object twice will likely have unintended results.
  • The above protection mechanism can be explicitly disabled through the setAllowMultipleExecution() function
  • It is now explicitly checked that the BaseCommand's version of the configure() function is called in overridden versions of the function
  • Similarly it is checked the the initialize() function in BaseCommand is also called to help the user in debugging why the bundle's functionality is not working
  • [BC] functions that are intended to only be used in the user's subclass (such as setLogFilename()) have all had their visibility updated to protected to make the public interface of your command cleaner

Logging

  • getLogFilename() now takes an optional boolean parameter to return just the filename. Previously it also included the full path to the file which meant that is was to symmetric with setLogFilename()
  • the default file extension can be set per command using setDefaultLogFileExtension()
  • logging to file can be disabled per command using setLogToFile()
  • The log LineFormat can be defined per command using setFileLogLineFormat() and setConsoleLogLineFormat(). NULL is a valid value for both functions if you would like to revert of Monolog's default format
  • [BC] The misspelt file_extention configuration option has been fixed to be file_extension
  • [BC] The node for configuring logging to file has been renamed from default to file_stream
  • The name of the log file can be changed for a single execution using the --log-filename parameter