syncevolution/src
Patrick Ohly 7f3dfc4241 command line: cleaned up output
The user-visible part of this change is that command line output now
uses the same [ERROR/INFO] prefixes like the rest of SyncEvolution,
instead of "Error:". Several messages were split into [ERROR] and
[INFO] parts on seperate lines. Multi-line messages with such a prefix
now have the prefix at the start of each line. Full sentences start
with captital letters.

All usage errors related to the synopsis of the command line now
include the synopsis, without the detailed documentation of all
options. Some of those errors dumped the full documentation, which was
way too much information and pushed the actual synopsis off the
screen. Some other errors did not include usage information at all.

All output still goes to stdout, stderr is not used at all. Should be
changed in a seperate patch, because currently error messages during
operations like "--export -" get mixed with the result of the
operation.

Technically the output handling was simplified. All output is printed
via the logging system, instead of using a mixture of logging and
streaming into std::cout. The advantage is that it will be easier to
redirect all regular output inside the syncevo-dbus-helper to the
parent. In particular, the following code could be removed:
- the somewhat hacky std::streambuf->logging bridge code (CmdlineStreamBuf)
- SyncContext set/getOutput()
- ostream constructor parameters for Cmdline and derived classes

The new code uses SE_LOG_SHOW() to produce output without prefix. Each
call ends at the next line, regardless whether the string ends in a
newline or not. The LoggerStdout was adapted to behave according to
that expectation, and it inserts the line prefix at the start of each
line - probably didn't matter before, because hardly any (no?!)
message had line breaks.

Because of this implicit newline in the logging code, some newlines
become redundant; SE_LOG_SHOW("") is used to insert an empty line
where needed. Calls to the logging system are minimized if possible by
assembling output in buffers first, to reduce overhead and to adhere
to the "one call per message" guideline.

Testing was adapted accordingly. It's a bit stricter now, too, because
it checks the entire error output instead of just the last line. The
previous use of Cmdline ostreams to capture output from the class was
replaced with loggers which hook into the logging system while the
test runs and store the output. Same with SyncContext testing.

Conflicts:

	src/dbus/server/cmdline-wrapper.h
2012-04-11 12:54:28 +02:00
..
backends WebDAV: support SyncML<->WebDAV bridge 2012-03-13 14:42:14 +01:00
dbus command line: cleaned up output 2012-04-11 12:54:28 +02:00
gdbus GDBus libdbus: add variant append support 2012-03-06 14:03:20 +01:00
gdbusxx GDBus GIO: add variant append support 2012-03-06 14:03:20 +01:00
gnome-bluetooth Merge remote-tracking branch 'origin/syncevolution-1-2-branch' 2011-11-28 10:16:57 +01:00
gtk-ui Revert "Do not accept service config without a username (BMC#23106)" 2012-03-30 07:31:59 +00:00
gtk3-ui autotools: fixed UI translation 2012-03-30 07:31:59 +00:00
syncevo command line: cleaned up output 2012-04-11 12:54:28 +02:00
synthesis-includes autotools: --disable-core --enable-gui => build only sync-ui and its D-Bus lib 2010-03-23 19:04:06 +01:00
templates Merge remote-tracking branch 'origin/syncevolution-1-2-branch' 2011-11-28 10:16:57 +01:00
async.patch patch switches to async version of the Evolution API 2007-02-22 19:33:21 +00:00
client-test-app.cpp testing: use glib log handler 2011-12-12 07:32:12 +00:00
client-test-buteo.cpp buteo-test: update tracker database file name 2010-12-15 15:45:23 +01:00
client-test-buteo.h buteo-test: update tracker database file name 2010-12-15 15:45:23 +01:00
CmdlineSyncClient.cpp SyncContext + ConfigUserInterface: code refactoring 2012-03-09 07:25:11 +00:00
CmdlineSyncClient.h SyncContext + ConfigUserInterface: code refactoring 2012-03-09 07:25:11 +00:00
README.h added missing copyright and license headers 2009-05-11 16:31:17 +02:00
README.templates Merge remote branch 'origin/syncevolution-0-9-branch' 2009-11-30 21:41:53 +01:00
shlibs.local reverted to 0.7 packaging 2008-07-03 19:56:15 +00:00
src.am autotools: fixed UI translation 2012-03-30 07:31:59 +00:00
syncevo-local-sync.cpp local sync: execute 'syncevo-local-sync' on child side, communicate via D-Bus 2012-01-20 13:38:49 +01:00
syncevolution.cpp command line: cleaned up output 2012-04-11 12:54:28 +02:00
testcases.am Port build system to non-recursive Automake. 2011-08-30 16:38:34 +02:00
valgrind.supp ObexTransportAgent: Fix valgrind warnings (MB#10091) 2010-03-12 06:33:13 -08:00

The configuration templates in "templates" get installed into
$(datadir)/syncevolution/templates.

When adding/changing a new server, then only enter the properties
which need to be changed here so that the default values can
be used for the remaining properties.

An icon can be added here for servers. The file name must start with
"icon".

Server configurations must be kept in sync in three different places:
- here (if a server is installed as files)
- in SyncEvolutionConfig.cpp's EvolutionSyncConfig::createServerTemplate()
- in SyncEvolutionCmdline.cpp's test server configs
- in test/test-dbus.py testGetConfigsTemplates()

Note that server icons must come with a suitable license that allows
redistribution.