Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicitly initialize seelog #2644

Merged
merged 1 commit into from
Oct 28, 2020
Merged

Explicitly initialize seelog #2644

merged 1 commit into from
Oct 28, 2020

Conversation

kzys
Copy link
Contributor

@kzys kzys commented Sep 18, 2020

Summary

The logger package's initialization logic is init() which will be
exected by loading the package.

However some of our programs are using the agent as a library and
haven't configured seelog beforehand. Due to that, loading the package
logs

1600397429848419666 [Error] node must have children

which breaks the programs.

I think it would be safer to do less on init() and explictly
initialize the logger from the agent's main().

Implementation details

Renamed logger.init() to logger.Init() and called the renamed/exported function from the agent's main().

Testing

New tests cover the changes:

Description for the changelog

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@kzys kzys force-pushed the logger-init branch 3 times, most recently from c5db8df to 38b5f0b Compare September 18, 2020 23:48
@yhlee-aws yhlee-aws changed the base branch from master to dev September 21, 2020 17:18
@kzys kzys force-pushed the logger-init branch 2 times, most recently from 5e31bb1 to 984bde2 Compare September 21, 2020 20:17
The logger package's initialization logic is init() which will be
executed by loading the package.

However some of our programs are using the agent as a library and
haven't configured seelog beforehand. Due to that, loading the package
logs

```
1600397429848419666 [Error] node must have children
```
which breaks the programs.

I think it would be safer to do less on init() and explicitly
initialize the logger from the agent's main().

Signed-off-by: Kazuyoshi Kato <[email protected]>
@mythri-garaga mythri-garaga added this to the 1.47.0 milestone Oct 27, 2020
@mythri-garaga mythri-garaga merged commit 006b065 into aws:dev Oct 28, 2020
@mythri-garaga mythri-garaga mentioned this pull request Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants