Commit graph

5 commits

Author SHA1 Message Date
Tao Jiang
86cc5a1a64 Update the libray reference path to new repo
Signed-off-by: Tao Jiang <taoj@vmware.com>
2021-12-21 13:49:47 -06:00
Connor McKelvey
7de4607b71 Add support for lease stealing (#78)
Fixes #4

Signed-off-by: Connor McKelvey <connormckelvey@gmail.com>
Signed-off-by: Ali Hobbs <alisuehobbs@gmail.com>
Co-authored-by: Ali Hobbs <alisuehobbs@gmail.com>

Co-authored-by: Ali Hobbs <alisuehobbs@gmail.com>
2021-12-20 21:21:15 -06:00
Mike Pye
10d6b28edf Use FieldLogger interface to represent logrus logger (#75)
The FieldLogger interface is satisfied by either *Logger or *Entry.
Accepting this interface in place of the concrete *Logger type allows
users to inject a logger with some fields already set. For example, the
application developer might want all logging from the library to have a
`subsystem=kcl` field.

Signed-off-by: Mike Pye <mail@mdpye.co.uk>
2021-12-20 21:21:15 -06:00
Tao Jiang
d6369e48c2 Fix the broken integrationt test (#48)
The https://github.com/vmware/vmware-go-kcl/pull/47 move zap
into its own packge but it also breaks the integration test.
This change is to fix integ test by correcting its package
reference.

Signed-off-by: Tao Jiang <taoj@vmware.com>
2021-12-20 21:21:15 -06:00
Tao Jiang
0d91fbd443 Add generic logger support (#43)
* Add generic logger support

The current KCL has tight coupling with logrus and it causes
issue for customer to use different logging system such as zap log.
The issue has been opened via:
https://github.com/vmware/vmware-go-kcl/issues/27

This change is to created a logger interface be able to abstract
above logrus and zap log. It makes easy to add support for other
logging system in the fugure. The work is based on:
https://www.mountedthoughts.com/golang-logger-interface/

Some updates are made in order to make logging system easily
injectable and add more unit tests.

Tested against real kinesis and dyamodb as well.

Signed-off-by: Tao Jiang <taoj@vmware.com>

* Add lumberjack configuration options to have fine grained control

Update the file log configuratio by adding most of luberjack
configuration to avoid hardcode default value. Let user to specify
the value because log retention and rotation are very important
for prod environment.

Signed-off-by: Tao Jiang <taoj@vmware.com>
2021-12-20 21:21:14 -06:00