Jon Surrell
d38e22329f
Replace count with empty check
2017-01-05 16:33:58 +01:00
Jon Surrell
e6bcc1aeb6
Replace 'All' with 'All sources' in dropdown
2017-01-05 16:23:03 +01:00
Jon Surrell
14e5bdcf91
Fix typos
2017-01-02 14:51:56 +01:00
Jon Surrell
4cfc6b4d04
Handle top and bottom bulk actions
2017-01-02 14:42:14 +01:00
Jon Surrell
b4b5c5124a
Refactor WC_Admin_Log_Table_List::prepare_items
...
Extract several methods to simplify structure and flow
2017-01-02 14:42:13 +01:00
Jon Surrell
90ef632fa5
Colorize leveles in db log table
2016-12-29 12:03:59 +01:00
Jon Surrell
a33fac966d
Use plural in multiple log email
2016-12-29 11:58:43 +01:00
Jon Surrell
4cf86ef346
Use constants over settings to configure logger
...
Settings have been removed.
WC_LOG_THRESHOLD and WC_LOG_HANDLER constants have been added.
2016-12-29 11:58:43 +01:00
Jon Surrell
e4681d268b
Remove logging
2016-12-29 11:58:43 +01:00
Jon Surrell
269addd9f8
Rework db log table
...
Change tag from text search to select list.
Flatten and clean up query logic.
Add required methods for source <select>.
2016-12-29 11:58:43 +01:00
Jon Surrell
c633b07f73
Fix style
2016-12-29 11:58:43 +01:00
Jon Surrell
588b1c2267
Format date in log viewer table
2016-12-29 11:58:43 +01:00
Jon Surrell
fbd91fe376
Improve email handler subject
2016-12-29 11:58:43 +01:00
Jon Surrell
4b13e3b053
Do not deprecate WC_Logger::add
2016-12-29 11:58:43 +01:00
Jon Surrell
e4d5886427
Replace log `tag` with log `source`
2016-12-29 11:58:43 +01:00
Jon Surrell
03889f77cc
Update use of deprecated wc_get_log_file_path
2016-12-29 11:58:43 +01:00
Jon Surrell
088fc5cd68
Delay file log write when written too early
...
The function to look up log file paths depends on `wp_hash`, which is pluggable.
Log files cannot be found before `plugins_loaded` action. In case a log is
written to a file before `wp_hash` is available, cache and write on
`plugins_loaded` action.
2016-12-29 11:58:43 +01:00
Jon Surrell
5700043e6d
Deprecate wc_get_log_file_path
...
wc_get_log_file_path moves into `WC_Log_Handler_File` class as a static
method.
Update deprecations and version info.
2016-12-29 11:58:43 +01:00
Jon Surrell
feefabbdf0
Document _legacy context in WC_Log_Handler_File
2016-12-29 11:58:43 +01:00
Jon Surrell
665e8ccfc6
Improve doc comments and access.
2016-12-29 11:58:43 +01:00
Jon Surrell
f908a0181c
Improve deprecation messages for WC_Logger
...
clear and remove *do* have alternatives. They have essentially
been moved to the file handler.
2016-12-29 11:58:43 +01:00
Jon Surrell
6068f681d3
Use 'notice' as level for deprecated WC_Logger::add messages.
...
Notice is the default (and recommended) threshold for production sites. Using
info, which is below notice, would result in ::add messages to be filtered by
default. This would be a confusing experience for users calling the deprecated
function and expecting a log.
2016-12-29 11:58:43 +01:00
Jon Surrell
de076a313e
Fix settings log texts
...
Add 'woocommerce' to __ translated texts.
Improve texts.
2016-12-29 11:58:43 +01:00
Jon Surrell
d4e8bb82e6
Remove new handler arguments from `wc_register_default_log_handler`
2016-12-29 11:58:43 +01:00
Jon Surrell
970a33e182
Cleanup log list table view
...
Format log timestamp.
Add is_valid_level check to $_REQUEST level filter.
General cleanup: formatting, layout, commentary.
2016-12-29 11:58:43 +01:00
Jon Surrell
aee5917440
Change wc_safe_dump to wc_print_r
...
Match print_r arguments, this makes usage obvious.
2016-12-29 11:58:43 +01:00
Jon Surrell
2ae1bc1ab2
Protect methods
2016-12-29 11:58:43 +01:00
Jon Surrell
fe837c5113
Aggregate email handler messages (max: 1 email/request/handler)
...
Update emails accordingly.
Update email handler tests.
2016-12-29 11:58:43 +01:00
Jon Surrell
acc98a1d6a
Mark WC_Log_Handler::format_entry abstract
2016-12-29 11:58:43 +01:00
Jon Surrell
5f24eca7e2
Add delete to db log viewer table
...
Clean up some nonce logic.
Use a single <form> containing log table.
2016-12-29 11:58:43 +01:00
Jon Surrell
9ba616b2c1
Return single instance from wc_get_logger
...
Remove class include from wc_get_logger (should be autoloaded).
Add tests for wc_get_logger.
2016-12-29 11:58:43 +01:00
Jonathan Surrell
4318b3aa53
Improve @return signature on WC_Log_Handler::handle
...
Make meaning of returned bool explicit.
Update WC_Log_Handler_Email::handle accordingly.
via https://github.com/woocommerce/woocommerce/pull/12575#pullrequestreview-12381573
2016-12-29 11:58:43 +01:00
Jon Surrell
81eaa5ae17
Make lot threshold strings translatable
2016-12-29 11:58:43 +01:00
Jon Surrell
080cf8e436
Store log levels as integer representations in database
...
This will allow indexed ordering by severity.
Add WC_Log_Levels::get_severity_level method to translate severity
integers to level strings. The inverse of WC_Log_Levels::get_level_severity.
Add context to tests.
2016-12-29 11:58:43 +01:00
Jon Surrell
78e6cb31a7
Include WC_Log_Handler with other abstracts
2016-12-29 11:58:43 +01:00
Jon Surrell
825d9c9f82
Fix spelling
2016-12-29 11:58:43 +01:00
Jon Surrell
88836b9cca
Drop WP_DEBUG override threshold. Improve logger tests.
...
This may be unexpected behavior for a user, their level is overridden with no
way to change it. It also greatly complicates testing default thresholds.
Dependency on WC_Log_Handler_File has been removed from logger tests.
2016-12-29 11:58:43 +01:00
Jon Surrell
2626c5b3af
Accept explicit handlers and threshold in WC_Logger
2016-12-29 11:58:43 +01:00
Jon Surrell
be38e8f2fe
Add log threshold setting to settings page
2016-12-29 11:58:43 +01:00
Jon Surrell
ffd0d380ee
Remove threshold logic from handlers.
...
Email handler implements threshold logic internally. Other handlers handle all logs received.
Handler constructors have changed.
2016-12-29 11:58:43 +01:00
Jon Surrell
2945b4755f
Add more information about log levels
2016-12-29 11:58:43 +01:00
Jon Surrell
85fa9df7fe
Drop "bubbling" support for logs
...
The concept of bubbling or consuming logs has little benefit for our use case.
Drop support for bubbling and simplify logging.
2016-12-29 11:58:43 +01:00
Jon Surrell
4f77954bc7
Move log levels to independent class
2016-12-29 11:58:43 +01:00
Jon Surrell
ae72ce24c4
Drop `var_dump` as safe dump alternative
...
var_dump does not support returning string representation.
2016-12-29 11:58:43 +01:00
Jon Surrell
d88ea4ecea
Spelling and doc fixes
2016-12-29 11:58:43 +01:00
Jon Surrell
0f13cca921
Use autoloader for log handlers
2016-12-29 11:58:43 +01:00
Jon Surrell
e2f76bcd54
Fix logs-db redirects
2016-12-29 11:58:42 +01:00
Jon Surrell
c633db9d65
Add woocommerce_default_log_handler setting
...
Adds configuration to settings page
Show status-logs page based on settings (unify logs & database logs)
Register default log handler by default
2016-12-29 11:58:42 +01:00
Jon Surrell
44ec07902d
Add confirmation to db log flush
2016-12-29 11:58:42 +01:00
Jon Surrell
9d80017308
Mark db handler add method as static
2016-12-29 11:58:42 +01:00