Skip to content

Commit

Permalink
*) Logging GUI handler: line-size is now set to max-size if max-size …
Browse files Browse the repository at this point in the history
…was exceeded

See: http://www.yacy-forum.de/viewtopic.php?p=36355

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3786 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
theli committed Jun 2, 2007
1 parent 94cc9f0 commit e1a5bab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion htroot/ViewLog_p.html
Expand Up @@ -11,7 +11,7 @@ <h2>Log</h2>

<form action="ViewLog_p.html" method="get" >
<fieldset>
<input type="text" name="lines" id="lines" size ="4" value="#[lines]#" maxlength="9" /><label for="lines"> Lines</label>
<input type="text" name="lines" id="lines" size ="4" value="#[lines]#" maxlength="9" /><label for="lines"> Lines (max. #[maxlines]#)</label>
<input type="checkbox" name="mode" id="mode" value="reversed" #(reverseChecked)#::checked="checked"#(/reverseChecked)# /><label for="mode">reversed order</label>
<input type="text" name="filter" id="filter" size ="30" value="#[filter]#" maxlength="60" />
<input type="submit" value="refresh" />
Expand Down
5 changes: 4 additions & 1 deletion htroot/ViewLog_p.java
Expand Up @@ -64,7 +64,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
serverObjects prop = new serverObjects();
String[] log = new String[0];
boolean reversed = false;
int lines = 200;
int maxlines = 400, lines = 200;
String filter = ".*.*";

if(post != null){
Expand All @@ -85,6 +85,8 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
boolean displaySubmenu = false;
for (int i=0; i<handlers.length; i++) {
if (handlers[i] instanceof GuiHandler) {
maxlines = ((GuiHandler)handlers[i]).getSize();
if (lines > maxlines) lines = maxlines;
log = ((GuiHandler)handlers[i]).getLogLines(reversed,lines);
} else if (handlers[i] instanceof LogalizerHandler) {
displaySubmenu = true;
Expand All @@ -94,6 +96,7 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
prop.put("submenu", (displaySubmenu) ? 1 : 0);
prop.put("reverseChecked", reversed ? 1 : 0);
prop.put("lines", lines);
prop.put("maxlines",maxlines);
prop.put("filter", filter);

// trying to compile the regular expression filter expression
Expand Down
4 changes: 4 additions & 0 deletions source/de/anomic/server/logging/GuiHandler.java
Expand Up @@ -131,6 +131,10 @@ private void init() {
this.count = 0;
}

public int getSize() {
return this.size;
}

public synchronized void publish(LogRecord record) {
if (!isLoggable(record)) return;

Expand Down

0 comments on commit e1a5bab

Please sign in to comment.