http://bugzilla.moblin.org/show_bug.cgi?id=5041
--- Comment #8 from pohly <patrick.ohly(a)intel.com> 2010-03-18 02:19:07 PST ---
(In reply to comment #7)
> I think I meant something like INFO/ERROR. Instead of inserting
those into a
> character data stream, the data sent to the client for formatting should be
> similar to what our logging code gets. Then for "normal" output we need
> something that says "don't add any prefix".
Since now Cmdline uses 'operator <<' to output text, to decrease changes,
I'd
like to define a new class passed to Cmdline:
class CmdlineOStream : public ostream {
void setLevel(Level level);
};
//Cmdline constructor
Cmdline(int argc, const char * const *argv, CmdlineOStream &out)
If a level is set, then the output text through this ostream is unless the
"is" what? Redirected?
Who calls setLevel() and why? I don't see a need for it.
When using Cmdline without D-Bus, pass std::cout. When using it inside
syncevo-dbus-server, implement a class derived from ostream which redirects
output via D-Bus. There must be virtual methods inside ostream which can be
used for that. The << operator itself cannot (and shouldn't) be used for that,
because it is not virtual and has different implementations, depending on the
right side of it.
> Instead of cout, a custom stream which passes the data into our
logging system
> with a suitable tag that reproduces the output verbatim on the console and logs
> it in the normal log should be used.
Command line won't use the log file 'syncevolution-log.html' only when a
session is started. you want to change this?
I was just saying that if such a file is written, it will be written by the
syncevo-dbus-server, not the client.
> Logging into the file would be done inside the engine, not at
the recipient.
it seems inconsistent. I understand the custom stream is passed by invokers and
in charge of reproduces output on the console and log it in the log in the
first paragraph.
Writing into the log file is done by LogDir, which implements LoggerBase. In
addition to writing into the file, it also invokes m_parentLogger. That logger
could either write to stdout or emit the D-Bus signals.
> Yes. This is required for example for "synccompare".
We already do that for
> stderr.
so redirecting stdout to '/dev/null' like stderr processing for
"synccompare"
is enough?
No. We want to *have* that output, not *discard* it ;-) What I referred to is
LogRedirect. Currently we only capture stderr and filter it. As soon as none of
our core code writes to file descriptor 1 anymore, we can also capture that
descriptor and pass it through our logging infrastructure, exactly like our own
"stdout" output. That way it will be recorded in
"syncevolution-log.html", if
it exists, (new and useful feature) in addition to being sent via D-Bus to the
syncevolution D-Bus client.
--
Configure bugmail:
http://bugzilla.moblin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
You are watching someone on the CC list of the bug.