Skip to content

Log levels and removing SLS_DEBUG #1720

@mthenw

Description

@mthenw

Right now serverless always output current step during deploy. It's always the same, so I'm not sure if it make sense to output that every time.

My proposition is to use log levels and output logs only if user ask for them.

serverless deploy --region us-west-2 --log-level info

Possible log levels:

  • info - same as current default
  • debug - same as current with SLS_DEBUG flag on
  • error - only errors

Proposed solution

(Added in later turn by maintainers)

Ideally if all logging in context of a Framework is pursued through log library which apart of supporting log levels also supports namespaces (debug style) and is already used in tests and some dependencies.

What's important, this will also open the door for pure programmatic use of core without producing CLI logs noise, as proposed log library does not write logs but just emit events, and it's a CLI handler through which a real CLI logs writer (log-node) is initialized which listens for events as emitted by log

When migrating Framework to new logger, ensure to also deprecate --verbose params in all commands, as output should be purely controlled via LOG_LEVEL and LOG_DEBUG environment variables

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions