logging-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thorsten Schöning (JIRA) <log4cxx-...@logging.apache.org>
Subject [jira] [Updated] (LOGCXX-493) Documentation claiming `getTimeStamp` is in milliseconds but actually is in microseconds
Date Mon, 16 Oct 2017 09:30:01 GMT

     [ https://issues.apache.org/jira/browse/LOGCXX-493?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Thorsten Schöning updated LOGCXX-493:
-------------------------------------
    Fix Version/s: 0.11.0

> Documentation claiming `getTimeStamp` is in milliseconds but actually is in microseconds
> ----------------------------------------------------------------------------------------
>
>                 Key: LOGCXX-493
>                 URL: https://issues.apache.org/jira/browse/LOGCXX-493
>             Project: Log4cxx
>          Issue Type: Bug
>          Components: Documentation
>    Affects Versions: 0.10.0
>            Reporter: Vincent Thiery
>            Assignee: Thorsten Schöning
>            Priority: Minor
>              Labels: easyfix
>             Fix For: 0.11.0
>
>
> The documentation implies that `getTimeStamp` returns a timesamp in *milliseconds*, see:
> {code:cpp}
> /** Return the timeStamp of this event. */
> inline log4cxx_time_t getTimeStamp() const
>         { return timeStamp; }
> {code}
> and the member
> {code:cpp}
> /** The number of milliseconds elapsed from 1/1/1970 until logging event
> was created. */
> log4cxx_time_t timeStamp;
> {code}
> The problem is that in the constructor of `LoggingEvent`, the timestamp is filled with
`apr_time_now()` that returns a timestamp in *microseconds*, see:
> {code:cpp}
> LoggingEvent::LoggingEvent(
>         const LogString& logger1, const LevelPtr& level1,
>         const LogString& message1, const LocationInfo& locationInfo1) :
>    logger(logger1),
>    level(level1),
>    ndc(0),
>    mdcCopy(0),
>    properties(0),
>    ndcLookupRequired(true),
>    mdcCopyLookupRequired(true),
>    message(message1),
>    timeStamp(apr_time_now()),
>    locationInfo(locationInfo1),
>    threadName(getCurrentThreadName()) {
> }
> {code}
> When encountered, the issue is not difficult to debug, but it would be nice to correct
the documentation.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message