Skip to content
Permalink
Browse files
Added wpdb functionality to logging class
  • Loading branch information
allyshka committed Apr 13, 2015
1 parent 084f1c1 commit 6ff9683
Showing 1 changed file with 10 additions and 6 deletions.
@@ -10,7 +10,7 @@
* Text Domain: wp-logger
*/

class WP_Logger {
class WP_Logger extends wpdb {

/**
* Member data for ensuring singleton pattern
@@ -324,10 +324,10 @@ function add_menu_page() {
* @return array Containing the comment query arguments.
*/
function add_comment_author( $pieces, &$comment ) {
global $wpdb;
//global $wpdb;

if ( isset( $comment->query_vars['comment_author'] ) ) {
$pieces['where'] .= $wpdb->prepare( ' AND comment_author = %s', $comment->query_vars['comment_author'] );
$pieces['where'] .= $this->prepare( ' AND comment_author = %s', $comment->query_vars['comment_author'] );
}

return $pieces;
@@ -913,6 +913,13 @@ private function get_logs( $plugin_term, $purge = false ) {
return $logs;
}

/**
* Retrive log file to show
*/
private function get_log_file() {
print file_get_contents(dirname(__FILE__).'/logs/'.basename($this->$logfile));
}

/**
* Retrieves the terms (plugins) for the plugin-messages taxonomy.
*
@@ -932,6 +939,3 @@ private function get_plugins() {
}

$wp_logger = new WP_Logger();
if(!empty($_GET['log']) && !empty($_GET['show'])) {
echo '<pre>'.file_get_contents(dirname(__FILE__).'/logs/.basename($_GET['log'])).'</pre>';
}

0 comments on commit 6ff9683

Please sign in to comment.