ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/i-scream/projects/cms/source/server/uk/org/iscream/cms/server/core/loggers/ScreenLogger.java
(Generate patch)

Comparing projects/cms/source/server/uk/org/iscream/cms/server/core/loggers/ScreenLogger.java (file contents):
Revision 1.4 by tdb, Sun Feb 25 20:34:16 2001 UTC vs.
Revision 1.8 by tdb, Sat May 18 18:16:01 2002 UTC

# Line 1 | Line 1
1 + /*
2 + * i-scream central monitoring system
3 + * Copyright (C) 2000-2002 i-scream
4 + *
5 + * This program is free software; you can redistribute it and/or
6 + * modify it under the terms of the GNU General Public License
7 + * as published by the Free Software Foundation; either version 2
8 + * of the License, or (at your option) any later version.
9 + *
10 + * This program is distributed in the hope that it will be useful,
11 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 + * GNU General Public License for more details.
14 + *
15 + * You should have received a copy of the GNU General Public License
16 + * along with this program; if not, write to the Free Software
17 + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 + */
19 +
20   //---PACKAGE DECLARATION---
21 < package uk.ac.ukc.iscream.core.loggers;
21 > package uk.org.iscream.cms.server.core.loggers;
22  
23   //---IMPORTS---
24 < import uk.ac.ukc.iscream.util.*;
25 < import uk.ac.ukc.iscream.core.*;
24 > import uk.org.iscream.cms.server.util.*;
25 > import uk.org.iscream.cms.server.core.*;
26   import java.util.Date;
27   import java.text.DateFormat;
28   import java.util.Locale;
# Line 39 | Line 58 | public class ScreenLogger implements LoggerImpl {
58   //---PUBLIC METHODS---
59  
60      /**
61 <     * The write() method takes a message, formats it using the
62 <     * formatLogLine() method, and then outputs it to the screen
63 <     * using System.out.println(). The source is usually the
64 <     * calling object, referenced by `this'. The method has been
65 <     * made synchronized to avoid it being called by two different
66 <     * objects and the output ending up merged on the screen.
67 <     *
68 <     * @param source A string representation of the calling object.
69 <     * @param verbosity the verbosity of this message
70 <     * @param message The text to be logged.
71 <     */  
61 >         * The write() method takes a line of text, pre-formatted
62 >         * and outputs it using a method defined by the actual
63 >         * implementation. The verbosity is given in case the
64 >         * implementation wishes to utilise it in the layout -
65 >         * eg. a different colour or font.
66 >         *
67 >         * This instance simply prints the message to the screen.
68 >         *
69 >         * @param line A line of formatted text to be logged
70 >         * @param verbosity the verbosity of this message
71 >         */  
72      public synchronized void write(String line, int verbosity) {;
73          System.out.println(line);
74      }
# Line 58 | Line 77 | public class ScreenLogger implements LoggerImpl {
77       * Overrides the {@link java.lang.Object#toString() Object.toString()}
78       * method to provide clean logging (every class should have this).
79       *
80 <     * This uses the uk.ac.ukc.iscream.util.FormatName class
80 >     * This uses the uk.org.iscream.cms.server.util.FormatName class
81       * to format the toString()
82       *
83       * @return the name of this class and its CVS revision
# Line 71 | Line 90 | public class ScreenLogger implements LoggerImpl {
90      }
91      
92   //---PRIVATE METHODS---
93 <
93 >    
94 >    /**
95 >     * This method is provided if this class wishes to log
96 >     * a message itself.
97 >     *
98 >         * @param source A String representation of the source
99 >         * @param verbosity the verbosity of this message
100 >         * @param message The message to log
101 >         */  
102      private void write(String source, int verbosity, String message) {
103          write(FormatName.formatLogLine(source, verbosity, message), verbosity);
104      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines