tools/slav.git
5 years agoAdd Entry structure and define logging methods 46/184746/7
Lukasz Wojciechowski [Thu, 19 Jul 2018 16:31:28 +0000 (18:31 +0200)]
Add Entry structure and define logging methods

Entry structure defines a single log entity.

Entries are created by Logger with private newEntry method.
Centralization of creation:
* allows proper initialization of Logger field;
* opens possibility of adding entries pool in future implementation
    for optimization purposes;
* opens possibility of adding logger's context to entries in future
    implementation.

Logger functions: Emergency, Alert, Critical, Error, Warning, Notice,
Info, Debug create new Entries and log them using process method.
There are also formatted variants of these methods with "f" suffix,
e.g. Errorf.

Similar methods are defined on Entry type. Those methods also call
process method finalizing and logging enries. They are used in case
of finalizing Entries.
This will be useful in case of structured Entries containing properties
or errors. These will be provided by future commits.

The process method verifies if Entry's level pass logger's threshold
and completes Entry structure. In future commits it will pass Entry
to be logged by the Logger.

Change-Id: If7f3b5d251e03031f2fde48e33eae91aa89c8614
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
5 years agoDefine initial version of Logger 45/184745/7
Lukasz Wojciechowski [Thu, 19 Jul 2018 12:30:28 +0000 (14:30 +0200)]
Define initial version of Logger

The new instance of a Logger can be created with NewLogger function.

It has one field: threshold defined, which is a general level for
the whole logger. Only more important log entries
(with lower Level value) will be processed by the Logger.

Patch defines SetThreshold and Threshold setter and getter
and a function PassThreshold for verification if entry level passes
Logger's threshold.

Change-Id: I3db0738dce2faef83f1e223c692465947f979535
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
6 years agoDefine log levels 44/184744/6
Lukasz Wojciechowski [Wed, 18 Jul 2018 19:36:23 +0000 (21:36 +0200)]
Define log levels

This patch introduces logger's log levels, which match exactly
standard UNIX syslog log levels.

This patch also initializes a unit test suite for logger.
It is based on ginkgo and uses gomega for matching expressions.

Change-Id: I8c29746b3f4c5813a6b3f96b44570788e9bb49e6
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
6 years agoAdd Apache 2.0 license 67/184967/2
Lukasz Wojciechowski [Tue, 24 Jul 2018 13:43:44 +0000 (15:43 +0200)]
Add Apache 2.0 license

Change-Id: I7df9324231b2039d363508deaf47f74e90593821
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
6 years agoInitial empty repository acdc api dryad infra util
Tizen Infrastructure [Sat, 24 Mar 2018 00:48:26 +0000 (00:48 +0000)]
Initial empty repository