Add clean logs support + dependent MR
-
Examiner les modifications -
-
Télécharger -
Correctifs
-
Diff brut
Description
Add some mechanisms to add log support to Vivy.
- A
LogSink
is an object that will collect all the logs and emit them to a file,stderr
, or in a Qt widget - A
Logger
is the object used to create log message and submit them to the sink - A
LogMessage
is a message, a line of log. You should not create it yourself, but use the macros or defined methods. They are submitted on destruction, so don't try things likeauto msg = VIVY_LOG_WARN(appLog); msg << "toto";
unless you know what you are doing. If you don't pay attention, you might get log messages in a different order than what you originally wanted.
Example
Here is a small demo:
// Custom sink
VIVY_DCL_LOG_SINK(logSink) // Declare a Sink
std::shared_ptr<Logger> scriptLog = VIVY_GET_LOGGER(mySink, SCRIPT); // Custom logger
VIVY_LOG_WARN(scriptLog) << "This is" << ' ' << "very usefull!"; // Use the custom logger
// With the vivyApp's sink
class Object {
// Add a logger to the sink and add log methods to the object
VIVY_APP_LOGGABLE_OBJECT(Object, logger)
public:
// ...
};
TODO List
-
Create and use the API -
The simple stderr dispatcher -
The VivyConsoleDispatcher
-> a dock widget with theMainWindow
, like the console with VSCode or Eclipse -
Create the LogDispatcherThread
-> flush at regular intervals theLogSink
Also merge dependent MR with this one to uniformize the logging process
Modification effectuée par Kubat
Rapports de requête de fusion
Comparer et
Afficher la dernière version
- version 263c6a8ccd
- version 258313c037
- version 24d85eff0d
- version 23e34c0a23
- version 228d42c780
- version 21a653603f
- version 2019c48a8c
- version 19201e2e16
- version 189803344f
- version 1727e17ac7
- version 1656366479
- version 15b11814ea
- version 14cc037f16
- version 1353c37247
- version 12064c56e0
- version 11478cc5cf
- version 1074a09b6a
- version 91506c2d1
- version 87db35b62
- version 7f4a50481
- version 68059746b
- version 5648084fe
- version 4a67b15d3
- version 3a67b15d3
- version 2a67b15d3
- version 13f1e12d7
- master (base)
- dernière versioncb2d019f51 validations,
- version 263c6a8ccd49 validations,
- version 258313c03748 validations,
- version 24d85eff0d47 validations,
- version 23e34c0a2339 validations,
- version 228d42c78034 validations,
- version 21a653603f33 validations,
- version 2019c48a8c32 validations,
- version 19201e2e1631 validations,
- version 189803344f30 validations,
- version 1727e17ac729 validations,
- version 165636647930 validations,
- version 15b11814ea35 validations,
- version 14cc037f1634 validations,
- version 1353c3724733 validations,
- version 12064c56e032 validations,
- version 11478cc5cf31 validations,
- version 1074a09b6a30 validations,
- version 91506c2d129 validations,
- version 87db35b6228 validations,
- version 7f4a5048127 validations,
- version 68059746b26 validations,
- version 5648084fe25 validations,
- version 4a67b15d322 validations,
- version 3a67b15d386 validations,
- version 2a67b15d322 validations,
- version 13f1e12d78 validations,
Comparer les modifications
- Côte à côte
- En ligne
Fichiers
3Chargement en cours