2
0
mirror of https://github.com/meganz/MEGAcmd synced 2025-08-29 12:57:44 +00:00

12 Commits

Author SHA1 Message Date
Diego Ximenez
f84580daa7
Merge branch 'develop' into feature/CMD-53_rotating_logger 2024-11-18 22:17:35 +01:00
Diego Ximenez
1fdbb2e8b7
Use a reference for the logged stream creation function 2024-07-05 14:19:46 +02:00
Diego Ximenez
a3b8afc971
Fix logged stream and .megaCmd directory creation order
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.
2024-06-21 13:46:33 +02:00
Pablo Martin
6354f2363b
more adjustments in cmake+vcpkg
- 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
2024-04-22 18:32:32 +02:00
Diego Ximenez
133904a964
Fix logged stream and ".megaCmd" creation order
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.
2024-03-12 13:45:45 +01:00
Diego Ximenez
66672ab3b2
Add FileRotatingLoggedStream class
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.
2024-02-05 18:08:00 +01:00
Pablo Martin
ecb0108555
minor adjustments
types, constrain mayUnisntall to windows, removed redundant virtuals,
args defined using vector.
2023-11-28 18:10:02 +01:00
Pablo Martin
420ce42cbf
fix compilation related to uninstall for windows 2023-11-03 17:08:39 +01:00
Pablo Martin
7f7c5cd28a
have server logs configurable
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
2023-11-03 15:17:21 +01:00
Pablo Martin
2f574c1b6e
have megacmd::executeServer always return integer 2023-10-09 18:05:06 +02:00
Pablo Martin
d4c27c6c33
Create initial integration & unit tests structure
- only qmake
- define mockup tests
- include instruments (to be used/adjusted)
2023-10-09 17:58:30 +02:00
Pablo Martin
968979c6e1
separate main from megacmd.cpp and have a new includable MEGAcmdServer.pri
expose executeServer and stopServer exposed in megacmd.h
2023-10-09 17:21:06 +02:00