Karl-Philipp Wulfert b2053c116e 0.3.1
2019-06-05 11:45:02 +02:00
2018-11-28 18:31:01 +01:00
2019-06-03 13:20:44 +02:00
2019-05-27 16:29:10 +02:00
2019-06-04 15:31:04 +02:00
2018-11-28 18:31:01 +01:00
2019-06-05 11:45:02 +02:00
2019-06-05 11:45:02 +02:00
2019-01-10 16:52:53 +01:00

@openstapps/logger

pipeline status coverage report

This is a simple logger for TypeScript projects with colors for console output.

Logs are only printed if their log level is equal or higher than the defined log level.

Log Levels

Available log levels are:

  • 1 - INFO
  • 2 - LOG
  • 4 - WARN
  • 8 - ERROR
  • 16 - OK

You can set your log level with the environment variable STAPPS_LOG_LEVEL.

To select your desired log levels add the corresponding numbers and set the value of STAPPS_LOG_LEVEL to the sum.

For example STAPPS_LOG_LEVEL=17 is 16 + 1 and would log everything that is OK or INFO.

If you want to use logger in production (NODE_ENV=production) and allow all transports to fail set ALLOW_NO_TRANSPORT to true.

SMTP

This class also provides a simple implementation of an SMTP transport which can be used as a TransportWithVerification for the logger. You can use this to transport errors of the logger or to transport mails of your own monitoring solution.

Usage

You can instatiate it with a config or it will check for a config in the environment variables. Environment variables can overwrite the actual config values.

Environment variables are:

  • SMTP_AUTH_USER: SMTP username
  • SMTP_AUTH_PASSWORD: SMTP password
  • SMTP_HOST: SMTP host
  • SMTP_PORT: SMTP port
  • SMTP_RECIPIENTS: comma seperated list of recipients
  • SMTP_CC: comma seperated list of recipients for the carbon copy (CC)
  • SMTP_SENDER_MAIL: sender of the mail
  • SMTP_SENDER_NAME: name of the sender
  • SMTP_SECURE: true to enable tls
Description
Monorepo that contains all projects for the Open StApps project.
Readme 56 MiB
Languages
TypeScript 85.8%
HTML 7.5%
SCSS 4%
JavaScript 1.6%
Dockerfile 0.4%
Other 0.5%