Since the logger might write to a file in the ".megaCmd" directory, this
directory needs to be created (in this case, by
`ConfigurationManager::loadConfiguration`) before the logged stream is
setup.
Note: changed ported over from rotating logger branch.
- fix wrongly resolved conflicts at BasicTests.cpp
- adjustments in docker and have all make_unique uses start using std's
- introduce REQUIRE_HAVE flags and associated options override
Since the logger might write to a file in the ".megaCmd" directory, this
directory needs to be created (in this case, by
`ConfigurationManager::loadConfiguration`) before the logged stream is
setup.
At the moment, this class provides a stream implementation that writes
messages to a message buffer, and pops them periodically in a different
thread to write to an output file. It also flushes the file accordingly
when required. Additionally, the message buffer is able to properly
handle Out Of Memory errors.
In the future it will rotate and compress the output file once a certain
size threshold is reached. It will also renew the output file if an
error is detected.
Kept existing funcitonality:
- running the server _manually_ will log to stdout
- running the server as a forked process will log to
~/.megaCmd/megacmdserver.log in POSIX
- log parameters and environment variables will remain working as they
where. Except: Windows no also accepts MEGACMD_LOGLEVEL environment
variable
Changes:
- integration tests will log into $HOME/.megaCmd/megacmdserver.log.
- forked stoud/stderr are now logged to separated files
- refactored some of the from ::executeServer into server main
- removed static `LoggedStream LCOUT(&COUT)` Use Instance pattern
instead. Owned by the executeServer scope.
- adjusted broken identification of source for log lines. Needs
robustifying
- added new LoggedStreamXXX clases (for stdout, for default log file,
for null)
- fix executeInClient args array