You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Kurt Grafius <ku...@jvoom.com> on 2001/06/12 23:31:06 UTC

[Patch] DataStreamParser

Below is a patch for DataStreamParser against the T_2_1_BRANCH that replaces
a system.out.println with a
write to the log system. This is my first patch submittal so give me a shout
if I'm not following protocol. Thanks.

Kurt


Index: DataStreamParser.java
===================================================================
RCS file:
/repository/tools/jakarta-turbine/src/java/org/apache/turbine/util/DataStrea
mParser.java,v
retrieving revision 1.1.1.1
diff -B -b -u -r1.1.1.1 DataStreamParser.java
--- DataStreamParser.java 2001/06/12 18:57:29 1.1.1.1
+++ DataStreamParser.java 2001/06/12 19:18:27
@@ -230,7 +230,7 @@
             {
                 String colname = it.next().toString();
                 String colval  = tokenizer.sval;
-                System.out.println(colname + "=" + colval);
+                Log.debug(colname + "=" + colval);
                 lineValues.add(colname, colval);
             }
             tokenizer.nextToken();


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Kurt Grafius" <ku...@jvoom.com> writes:

> Not being the original author of this particular piece of code and this
> being my first Turbine code patch I thought I would tread lightly which is
> why I changed the system.out.println call to use the logging system instead.
> This at least gives the developer an opportunity to control where the
> message goes. Honestly, I didn't give the actual message being output much
> thought. I'll revisit the code and either:
> 
> a) Supply a little information with the Log.debug(..) call as you suggested.
> 
> OR
> 
> b) Remove the Log.debug(..) call entirely. ( my choice as I originally
> encountered this message while processing a csv file with 25k values which
> each produced a msg)

OR

c) Gate that bit of debug with a conditional compilation flag.

    private static final DEBUG = false;

...

        if (DEBUG)
        {
            Log.debug(...);
        }


Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Kurt Grafius <ku...@jvoom.com>.
Not being the original author of this particular piece of code and this
being my first Turbine code patch I thought I would tread lightly which is
why I changed the system.out.println call to use the logging system instead.
This at least gives the developer an opportunity to control where the
message goes. Honestly, I didn't give the actual message being output much
thought. I'll revisit the code and either:

a) Supply a little information with the Log.debug(..) call as you suggested.

OR

b) Remove the Log.debug(..) call entirely. ( my choice as I originally
encountered this message while processing a csv file with 25k values which
each produced a msg)

Kurt

----- Original Message -----
From: "Daniel Rall" <dl...@finemaltcoding.com>
To: <tu...@jakarta.apache.org>
Sent: Tuesday, June 12, 2001 7:01 PM
Subject: Re: [Patch] DataStreamParser


> Would you mind having this debug trace supply a little more
> information?  In an application like Tigris, and unqualified debug
> statement like this is basically worse than useless, since I can't
> tell what is producing it and it just gets in the way of debug which I
> might actually be searching for.  Thanks.
>
> Daniel
>
>
> Jon Stevens <jo...@latchkey.com> writes:
>
> > on 6/12/01 2:31 PM, "Kurt Grafius" <ku...@jvoom.com> wrote:
> >
> > > Below is a patch for DataStreamParser against the T_2_1_BRANCH that
replaces
> > > a system.out.println with a
> > > write to the log system. This is my first patch submittal so give me a
shout
> > > if I'm not following protocol. Thanks.
> > >
> > > Kurt
> > >
> > >
> > > Index: DataStreamParser.java
> > > ===================================================================
> > > RCS file:
> > >
/repository/tools/jakarta-turbine/src/java/org/apache/turbine/util/DataStrea
> > > mParser.java,v
> > > retrieving revision 1.1.1.1
> > > diff -B -b -u -r1.1.1.1 DataStreamParser.java
> > > --- DataStreamParser.java 2001/06/12 18:57:29 1.1.1.1
> > > +++ DataStreamParser.java 2001/06/12 19:18:27
> > > @@ -230,7 +230,7 @@
> > >            {
> > >                String colname = it.next().toString();
> > >                String colval  = tokenizer.sval;
> > > -                System.out.println(colname + "=" + colval);
> > > +                Log.debug(colname + "=" + colval);
> > >                lineValues.add(colname, colval);
> > >            }
> > >            tokenizer.nextToken();
> >
> > Done...except that you forgot an import. :-)
> >
> > -jon
> >
> > --
> > "Open source is not available to commercial companies."
> >             -Steve Ballmer, CEO Microsoft
> > <http://www.suntimes.com/output/tech/cst-fin-micro01.html>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/12/01 7:01 PM, "Daniel Rall" <dl...@finemaltcoding.com> wrote:

> Would you mind having this debug trace supply a little more
> information?  In an application like Tigris, and unqualified debug
> statement like this is basically worse than useless, since I can't
> tell what is producing it and it just gets in the way of debug which I
> might actually be searching for.  Thanks.
> 
> Daniel

Sure.

Personally, I would rather comment out the debugging stuff in there and
remove the dependency on o.a.t.u.Log

:-)

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Ballmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Would you mind having this debug trace supply a little more
information?  In an application like Tigris, and unqualified debug
statement like this is basically worse than useless, since I can't
tell what is producing it and it just gets in the way of debug which I
might actually be searching for.  Thanks.

Daniel


Jon Stevens <jo...@latchkey.com> writes:

> on 6/12/01 2:31 PM, "Kurt Grafius" <ku...@jvoom.com> wrote:
> 
> > Below is a patch for DataStreamParser against the T_2_1_BRANCH that replaces
> > a system.out.println with a
> > write to the log system. This is my first patch submittal so give me a shout
> > if I'm not following protocol. Thanks.
> > 
> > Kurt
> > 
> > 
> > Index: DataStreamParser.java
> > ===================================================================
> > RCS file:
> > /repository/tools/jakarta-turbine/src/java/org/apache/turbine/util/DataStrea
> > mParser.java,v
> > retrieving revision 1.1.1.1
> > diff -B -b -u -r1.1.1.1 DataStreamParser.java
> > --- DataStreamParser.java 2001/06/12 18:57:29 1.1.1.1
> > +++ DataStreamParser.java 2001/06/12 19:18:27
> > @@ -230,7 +230,7 @@
> >            {
> >                String colname = it.next().toString();
> >                String colval  = tokenizer.sval;
> > -                System.out.println(colname + "=" + colval);
> > +                Log.debug(colname + "=" + colval);
> >                lineValues.add(colname, colval);
> >            }
> >            tokenizer.nextToken();
> 
> Done...except that you forgot an import. :-)
> 
> -jon
> 
> -- 
> "Open source is not available to commercial companies."
>             -Steve Ballmer, CEO Microsoft
> <http://www.suntimes.com/output/tech/cst-fin-micro01.html>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/12/01 3:14 PM, "Kurt Grafius" <ku...@jvoom.com> wrote:

> Thanks. That was easy. Is it possible to also get this applied to
> T_2_1_BRANCH?

Yes...jason will eventually merge them together...he is the "merge
master"...

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Ballmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Kurt Grafius <ku...@jvoom.com>.
Thanks. That was easy. Is it possible to also get this applied to
T_2_1_BRANCH?

----- Original Message -----
From: "Jon Stevens" <jo...@latchkey.com>
To: "turbine-dev" <tu...@jakarta.apache.org>
Sent: Tuesday, June 12, 2001 2:40 PM
Subject: Re: [Patch] DataStreamParser


> on 6/12/01 2:31 PM, "Kurt Grafius" <ku...@jvoom.com> wrote:
>
> > Below is a patch for DataStreamParser against the T_2_1_BRANCH that
replaces
> > a system.out.println with a
> > write to the log system. This is my first patch submittal so give me a
shout
> > if I'm not following protocol. Thanks.
> >
> > Kurt
> >
> >
> > Index: DataStreamParser.java
> > ===================================================================
> > RCS file:
> >
/repository/tools/jakarta-turbine/src/java/org/apache/turbine/util/DataStrea
> > mParser.java,v
> > retrieving revision 1.1.1.1
> > diff -B -b -u -r1.1.1.1 DataStreamParser.java
> > --- DataStreamParser.java 2001/06/12 18:57:29 1.1.1.1
> > +++ DataStreamParser.java 2001/06/12 19:18:27
> > @@ -230,7 +230,7 @@
> >            {
> >                String colname = it.next().toString();
> >                String colval  = tokenizer.sval;
> > -                System.out.println(colname + "=" + colval);
> > +                Log.debug(colname + "=" + colval);
> >                lineValues.add(colname, colval);
> >            }
> >            tokenizer.nextToken();
>
> Done...except that you forgot an import. :-)
>
> -jon
>
> --
> "Open source is not available to commercial companies."
>             -Steve Ballmer, CEO Microsoft
> <http://www.suntimes.com/output/tech/cst-fin-micro01.html>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org


Re: [Patch] DataStreamParser

Posted by Jon Stevens <jo...@latchkey.com>.
on 6/12/01 2:31 PM, "Kurt Grafius" <ku...@jvoom.com> wrote:

> Below is a patch for DataStreamParser against the T_2_1_BRANCH that replaces
> a system.out.println with a
> write to the log system. This is my first patch submittal so give me a shout
> if I'm not following protocol. Thanks.
> 
> Kurt
> 
> 
> Index: DataStreamParser.java
> ===================================================================
> RCS file:
> /repository/tools/jakarta-turbine/src/java/org/apache/turbine/util/DataStrea
> mParser.java,v
> retrieving revision 1.1.1.1
> diff -B -b -u -r1.1.1.1 DataStreamParser.java
> --- DataStreamParser.java 2001/06/12 18:57:29 1.1.1.1
> +++ DataStreamParser.java 2001/06/12 19:18:27
> @@ -230,7 +230,7 @@
>            {
>                String colname = it.next().toString();
>                String colval  = tokenizer.sval;
> -                System.out.println(colname + "=" + colval);
> +                Log.debug(colname + "=" + colval);
>                lineValues.add(colname, colval);
>            }
>            tokenizer.nextToken();

Done...except that you forgot an import. :-)

-jon

-- 
"Open source is not available to commercial companies."
            -Steve Ballmer, CEO Microsoft
<http://www.suntimes.com/output/tech/cst-fin-micro01.html>


---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-dev-help@jakarta.apache.org