You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@whimsical.apache.org by cu...@apache.org on 2018/05/07 21:45:50 UTC

[whimsy] branch master updated: Comment on default ERROR_LOG_DIR

This is an automated email from the ASF dual-hosted git repository.

curcuru pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/whimsy.git


The following commit(s) were added to refs/heads/master by this push:
     new b265dc3  Comment on default ERROR_LOG_DIR
b265dc3 is described below

commit b265dc39746860232b4185e3b0c6c06b16d4758f
Author: Shane Curcuru <as...@shanecurcuru.org>
AuthorDate: Mon May 7 17:45:44 2018 -0400

    Comment on default ERROR_LOG_DIR
---
 lib/whimsy/logparser.rb | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lib/whimsy/logparser.rb b/lib/whimsy/logparser.rb
index 5e384bc..6250b79 100755
--- a/lib/whimsy/logparser.rb
+++ b/lib/whimsy/logparser.rb
@@ -9,6 +9,8 @@ require 'zlib'
 # Utility methods to turn server logs into hashes of interesting data
 module LogParser
   extend self
+  # Hardcoded from https://github.com/apache/infrastructure-puppet/blob/deployment/modules/whimsy_server/manifests/init.pp#L200
+  ERROR_LOG_DIR = '/srv/whimsy/www/members/log'
   
   # Constants and ignored regex for whimsy_access logs
   RUSER = 'remote_user'
@@ -152,8 +154,7 @@ module LogParser
   # Parse error.log* files in dir and return interesting entries
   # @param d directory to scan for error.log*
   # @return hash of arrays of interesting entries
-  def parse_error_logs(d, logs = {})
-    
+  def parse_error_logs(d = ERROR_LOG_DIR, logs = {})
     Dir[File.join(d, 'error.lo*')].each do |f|
       parse_error_log(f, logs)
     end
@@ -182,7 +183,7 @@ module LogParser
   # Parse whimsy_error.log* files in dir and return interesting entries
   # @param d directory to scan for whimsy_error.log*
   # @return hash of arrays of interesting entries
-  def parse_whimsy_errors(d, logs = {})
+  def parse_whimsy_errors(d = ERROR_LOG_DIR, logs = {})
     Dir[File.join(d, 'whimsy_error.lo*')].each do |f|
       parse_whimsy_error(f, logs)
     end
@@ -192,7 +193,7 @@ module LogParser
   # Get a list of all current|available error logs interesting entries
   # @param d directory to scan for *error.log*
   # @return hash of arrays of interesting entries
-  def get_errors(d = '/x1/srv/whimsy/www/members/log', current = true)
+  def get_errors(d = ERROR_LOG_DIR, current = true)
     if current
       logs = LogParser.parse_whimsy_error(File.join(d, 'whimsy_error.log'))
       LogParser.parse_error_log(File.join(d, 'error.log'), logs)

-- 
To stop receiving notification emails like this one, please contact
curcuru@apache.org.