You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4cxx-dev@logging.apache.org by mc...@apache.org on 2004/05/20 10:04:38 UTC
cvs commit: logging-log4cxx/include/log4cxx/helpers dateformat.h relativetimedateformat.h
mcatan 2004/05/20 01:04:38
Modified: include/log4cxx dailyrollingfileappender.h patternlayout.h
include/log4cxx/helpers dateformat.h
relativetimedateformat.h
Log:
updated doxygen documentation
Revision Changes Path
1.9 +9 -10 logging-log4cxx/include/log4cxx/dailyrollingfileappender.h
Index: dailyrollingfileappender.h
===================================================================
RCS file: /home/cvs/logging-log4cxx/include/log4cxx/dailyrollingfileappender.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- dailyrollingfileappender.h 24 Apr 2004 06:55:01 -0000 1.8
+++ dailyrollingfileappender.h 20 May 2004 08:04:38 -0000 1.9
@@ -97,13 +97,12 @@
<p>The rolling schedule is specified by the <b>DatePattern</b>
option. This pattern should follow the helpers::DateFormat
- conventions. In particular, you <em>must</em> escape literal text
- within a pair of single quotes. A formatted version of the date
+ conventions. A formatted version of the date
pattern is used as the suffix for the rolled file name.
<p>For example, if the <b>File</b> option is set to
<code>/foo/bar.log</code> and the <b>DatePattern</b> set to
- <code>'.'yyyy-MM-dd</code>, on 2001-02-16 at midnight, the logging
+ <code>.\%Y-\%m-\%d</code>, on 2001-02-16 at midnight, the logging
file <code>/foo/bar.log</code> will be copied to
<code>/foo/bar.log.2001-02-16</code> and logging for 2001-02-17
will continue in <code>/foo/bar.log</code> until it rolls over
@@ -119,7 +118,7 @@
<th>Example</th>
<tr>
- <td><code>'.'yyyy-MM</code>
+ <td><code>.\%Y-\%m</code>
<td>Rollover at the beginning of each month</td>
<td>At midnight of May 31st, 2002 <code>/foo/bar.log</code> will be
@@ -128,7 +127,7 @@
also rolled over the next month.
<tr>
- <td><code>'.'yyyy-ww</code>
+ <td><code>.\%Y-\%W</code>
<td>Rollover at the first day of each week. The first day of the
week depends on the locale.</td>
@@ -140,7 +139,7 @@
rolled over the next week.
<tr>
- <td><code>'.'yyyy-MM-dd</code>
+ <td><code>.\%Y-\%m-\%d</code>
<td>Rollover at midnight each day.</td>
@@ -150,7 +149,7 @@
is rolled over the next day.
<tr>
- <td><code>'.'yyyy-MM-dd-a</code>
+ <td><code>.\%Y-\%m-\%d-\%p</code>
<td>Rollover at midnight and midday of each day.</td>
@@ -160,7 +159,7 @@
until it is rolled over at midnight.
<tr>
- <td><code>'.'yyyy-MM-dd-HH</code>
+ <td><code>.\%Y-\%m-\%d-\%H</code>
<td>Rollover at the top of every hour.</td>
@@ -172,7 +171,7 @@
<tr>
- <td><code>'.'yyyy-MM-dd-HH-mm</code>
+ <td><code>.\%Y-\%m-\%d-\%H-\%M</code>
<td>Rollover at the beginning of every minute.</td>
@@ -247,7 +246,7 @@
/**
The date pattern. By default, the pattern is set to
- "'.'yyyy-MM-dd" meaning daily rollover.
+ ".%Y-%m-%d" meaning daily rollover.
*/
String datePattern;
1.16 +23 -23 logging-log4cxx/include/log4cxx/patternlayout.h
Index: patternlayout.h
===================================================================
RCS file: /home/cvs/logging-log4cxx/include/log4cxx/patternlayout.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- patternlayout.h 24 Apr 2004 06:55:01 -0000 1.15
+++ patternlayout.h 20 May 2004 08:04:38 -0000 1.16
@@ -110,29 +110,29 @@
ISO8601 format} is assumed.
<p>The Following format options are possible:
- - %a -- Abbreviated weekday name
- - %A -- Full weekday name
- - %b -- Abbreviated month name
- - %B -- Full month name
- - %c -- Standard date and time string
- - %d -- Day of month as a decimal(1-31)
- - %H -- Hour(0-23)
- - %I -- Hour(1-12)
- - %j -- Day of year as a decimal(1-366)
- - %m -- Month as decimal(1-12)
- - %M -- Minute as decimal(00-59)
- - %p -- Locale's equivalent of AM or PM
- - %Q -- Millisecond as decimal (000-999)
- - %S -- Second as decimal(00-59)
- - %U -- Week of year, Sunday being first day(0-53)
- - %w -- Weekday as a decimal(0-6, Sunday being 0)
- - %W -- Week of year, Monday being first day(0-53)
- - %x -- Standard date string
- - %X -- Standard time string
- - %y -- Year in decimal without century(0-99)
- - %Y -- Year including century as decimal
- - %Z -- Time zone name
- - %% -- The percent sign
+ - \%a -- Abbreviated weekday name
+ - \%A -- Full weekday name
+ - \%b -- Abbreviated month name
+ - \%B -- Full month name
+ - \%c -- Standard date and time string
+ - \%d -- Day of month as a decimal(1-31)
+ - \%H -- Hour(0-23)
+ - \%I -- Hour(1-12)
+ - \%j -- Day of year as a decimal(1-366)
+ - \%m -- Month as decimal(1-12)
+ - \%M -- Minute as decimal(00-59)
+ - \%p -- Locale's equivalent of AM or PM
+ - \%Q -- Millisecond as decimal (000-999)
+ - \%S -- Second as decimal(00-59)
+ - \%U -- Week of year, Sunday being first day(0-53)
+ - \%w -- Weekday as a decimal(0-6, Sunday being 0)
+ - \%W -- Week of year, Monday being first day(0-53)
+ - \%x -- Standard date string
+ - \%X -- Standard time string
+ - \%y -- Year in decimal without century(0-99)
+ - \%Y -- Year including century as decimal
+ - \%Z -- Time zone name
+ - \%\% -- The percent sign
<p>Lookup the documentation for the <code>strftime()</code> function
found in the <code><ctime></code> header for more information.
1.15 +67 -4 logging-log4cxx/include/log4cxx/helpers/dateformat.h
Index: dateformat.h
===================================================================
RCS file: /home/cvs/logging-log4cxx/include/log4cxx/helpers/dateformat.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- dateformat.h 13 May 2004 21:07:55 -0000 1.14
+++ dateformat.h 20 May 2004 08:04:38 -0000 1.15
@@ -27,15 +27,78 @@
/**
Concrete class for formatting and parsing dates in a
locale-sensitive manner.
+
+ Date and time formats are specified by date and time pattern strings.
+ Within date and time pattern strings, letters from 'A' to 'Z' and from
+ 'a' to 'z', preceded by the character '%', are interpreted as pattern
+ letters representing the components of a date or time string
+
+ The following pattern letters are defined:
+ - \%a -- Abbreviated weekday name
+ - \%A -- Full weekday name
+ - \%b -- Abbreviated month name
+ - \%B -- Full month name
+ - \%c -- Standard date and time string
+ - \%d -- Day of month as a decimal(1-31)
+ - \%H -- Hour(0-23)
+ - \%I -- Hour(1-12)
+ - \%j -- Day of year as a decimal(1-366)
+ - \%m -- Month as decimal(1-12)
+ - \%M -- Minute as decimal(00-59)
+ - \%p -- Locale's equivalent of AM or PM
+ - \%Q -- Millisecond as decimal (000-999)
+ - \%S -- Second as decimal(00-59)
+ - \%U -- Week of year, Sunday being first day(0-53)
+ - \%w -- Weekday as a decimal(0-6, Sunday being 0)
+ - \%W -- Week of year, Monday being first day(0-53)
+ - \%x -- Standard date string
+ - \%X -- Standard time string
+ - \%y -- Year in decimal without century(0-99)
+ - \%Y -- Year including century as decimal
+ - \%Z -- Time zone name
+ - \%\% -- The percent sign
*/
class LOG4CXX_EXPORT DateFormat
{
public:
- DateFormat(const String& dateFormat);
- DateFormat(const String& dateFormat, const TimeZonePtr& timeZone);
+ /**
+ Constructs a DateFormat using the given pattern and the default
+ time zone.
+
+ @param pattern the pattern describing the date and time format
+ */
+ DateFormat(const String& pattern);
+
+ /**
+ Constructs a DateFormat using the given pattern and the given
+ time zone.
+
+ @param pattern the pattern describing the date and time format
+ @param timeZone the timeZone to be used in the formatting
+ operations.
+ */
+ DateFormat(const String& pattern, const TimeZonePtr& timeZone);
virtual ~DateFormat();
- virtual void format(ostream& os, int64_t time) const;
- String format(int64_t timeMillis) const;
+
+ /**
+ Formats a Date into a date/time string.
+
+ @param toAppendTo the stream for the returning date/time string.
+
+ @param time the time value (in milliseconds since
+ January 1, 1970 00:00:00 GMT) to be formatted into a time string.
+ */
+ virtual void format(ostream& toAppendTo, int64_t time) const;
+
+ /**
+ Formats a Date into a date/time string.
+
+ @param time the time value (in milliseconds since
+ January 1, 1970 00:00:00 GMT) to be formatted into a time string.
+
+ @return the formatted time string.
+ */
+ String format(int64_t time) const;
protected:
TimeZonePtr timeZone;
1.11 +1 -1 logging-log4cxx/include/log4cxx/helpers/relativetimedateformat.h
Index: relativetimedateformat.h
===================================================================
RCS file: /home/cvs/logging-log4cxx/include/log4cxx/helpers/relativetimedateformat.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- relativetimedateformat.h 24 Apr 2004 06:55:01 -0000 1.10
+++ relativetimedateformat.h 20 May 2004 08:04:38 -0000 1.11
@@ -40,7 +40,7 @@
{
}
- virtual void format(ostream& os, int64_t time) const
+ virtual void format(ostream& toAppendTo, int64_t time) const
{
os << (time - startTime);
}