Commit Graph

71 Commits

Author SHA1 Message Date
Jon Surrell 5a9db9738f Add DB log handler 2016-12-29 11:58:42 +01:00
Jon Surrell 09ea8b074e Prefer PHP_EOL over "\n" 2016-12-29 11:58:42 +01:00
Jon Surrell 822981c009 Improve handle signature
The signature of WC_Log_Handler::handle mirrors log messages which is more intuitive.
Method docblocks have also been improved and are more complete.
2016-12-29 11:58:42 +01:00
Jon Surrell e7d6a9a48b Rotate logs
WC_Log_Handler_File now includes log rotation.
Add and improve tests.
2016-12-29 11:58:42 +01:00
Jon Surrell 2a6c95b490 Prevent possible undefined index warning 2016-12-29 11:58:42 +01:00
Jon Surrell 75c3e5e8c6 Fix phpcs warning 2016-12-29 11:58:42 +01:00
Jon Surrell b645fa06b7 Improve logic for legacy `->add` message formatting
Suggestion via https://github.com/woocommerce/woocommerce/pull/12340#discussion_r88318220
2016-12-29 11:58:42 +01:00
Jon Surrell 611577320f Include site name in log email message
Suggestion via https://github.com/woocommerce/woocommerce/pull/12340#discussion_r88213040
2016-12-29 11:58:42 +01:00
Jon Surrell f0508a0fc6 Improve log email message format.
Suggestion via https://github.com/woocommerce/woocommerce/pull/12340#pullrequestreview-8895028
2016-12-29 11:58:42 +01:00
Jon Surrell e4c08aa03a Remove optional from required log handler context array 2016-12-29 11:58:42 +01:00
Jon Surrell 722b288b79 Remove _ from private/protected properties 2016-12-29 11:58:42 +01:00
Jon Surrell b2935f35ed Fix file handle regression 2016-12-29 11:58:42 +01:00
Jon Surrell b5cebcab6c Fix scrutinizer issues 2016-12-29 11:58:42 +01:00
Jon Surrell d5d1ab16ea Fix docblocks 2016-12-29 11:58:42 +01:00
Jon Surrell 36873e5097 Provide basic messages for email log handler 2016-12-29 11:58:42 +01:00
Jon Surrell 479ef85cd8 Add email log handler 2016-12-29 11:58:42 +01:00
Jon Surrell 864e65de10 Remove redundant __constructor 2016-12-29 11:58:42 +01:00
Jon Surrell 44ea69c579 Adds tests for bubbling, etc.
Add tests teardown to cleanup log files
Fix errors in log handlers
2016-12-29 11:58:42 +01:00
Jon Surrell 0e0433195d Add logic for log level filtering to `WC_Log_Handler`. 2016-12-29 11:58:42 +01:00
Jon Surrell 9a0efcfe55 Add abstract WC_Log_Handler class
Abstract base class is implemented with default formatting implementations.
`$timestamp` has been added to the `WC_Log_Handler::handle` implementation. This ensures all handlers are passed the same timestamp for the same message.
`_legacy` context has been added to `WC_Log_Handler_File` to ensure handle deprecated `WC_Logger::add` provides the same log entries as before.

Fix CS problems.
2016-12-29 11:58:42 +01:00
Jon Surrell e922efb0f7 Extract file log handler 2016-12-29 11:58:42 +01:00