SungardAS / lambda-formation

A small framework for building nodejs AWS Lambda projects that are compatible with AWS CloudFormation Custom Resources
Apache License 2.0
22 stars 4 forks source link

Logging #9

Closed estahn closed 7 years ago

estahn commented 7 years ago

This is a feature request to add logging out of the box.

estahn commented 7 years ago

@kmcgrath See #10

estahn commented 7 years ago

@kmcgrath Did you have a chance to look at the pull requests?

kmcgrath commented 7 years ago

@estahn thank you for the requests. I have seen them, but won't be able to give them a good look until tomorrow or Saturday.

They are in my queue ;)

kmcgrath commented 7 years ago

I like this idea.

Implemented something similar in spotinst-lambda

At the time the decision was to push logs to downstream projects to keep lambda-formation as light as possible. With that said, logs are a very fundamental thing that should probably be supported by the framework.

Running short on time tonight, but will come back to this tomorrow. Just want to compare what we did before and this.

estahn commented 7 years ago

Yes, I think I copied the winston part from cfn-responder. The only bit I dislike is the use of process.env.CFN_LOG_LEVEL directly in lib/logger/index.js.

It might be a better idea to do something with a config object, e.g.

var LambdaFormation = require('lambda-formation');

LambdaFormation.config.log_level = process.env.CFN_LOG_LEVEL;

And use this in lib/logger/index.js.

kmcgrath commented 7 years ago

Thanks again for the submission! #10 has been merged.