Need to do the right thing for first log line wrap width as well.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@771 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: DefaultLogProvider.java,v 1.7 2002/05/31 21:15:27 mdb Exp $
|
// $Id: DefaultLogProvider.java,v 1.8 2002/05/31 21:19:58 mdb Exp $
|
||||||
//
|
//
|
||||||
// samskivert library - useful routines for java programs
|
// samskivert library - useful routines for java programs
|
||||||
// Copyright (C) 2001 Michael Bayne
|
// Copyright (C) 2001 Michael Bayne
|
||||||
@@ -102,7 +102,10 @@ public class DefaultLogProvider implements LogProvider
|
|||||||
// we'll be wrapping the log lines
|
// we'll be wrapping the log lines
|
||||||
int wrapwid = LOG_LINE_LENGTH - GAP.length();
|
int wrapwid = LOG_LINE_LENGTH - GAP.length();
|
||||||
int remain = message.length(), offset = 0;
|
int remain = message.length(), offset = 0;
|
||||||
int linewid = Math.min(LOG_LINE_LENGTH - buf.length(), remain);
|
|
||||||
|
// our first line contains additionally, the module name (and a
|
||||||
|
// colon and space) which must be accountded for when wrapping
|
||||||
|
int linewid = Math.min(wrapwid - moduleName.length() - 2, remain);
|
||||||
|
|
||||||
// append the first line
|
// append the first line
|
||||||
buf.append(message.substring(offset, offset+linewid));
|
buf.append(message.substring(offset, offset+linewid));
|
||||||
|
|||||||
Reference in New Issue
Block a user