Logger with colors, loglevel and transport

Log level can be defined by setting the environment variable STAPPS_LOG_LEVEL to a valid log level. Log levels are set in a binary way. For example STAPPS_LOG_LEVEL=12 does result in logs only for `Logger.warn` and `Logger.error`.

Log levels in that order are:

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

### Hierarchy

- Logger

## Index

### Constructors

- constructor

### Properties

- checkLogLevel
- cyan
- getLogLevel
- green
- isNode
- isProductiveEnvironment
- isTransportWithVerification
- logLevels
- red
- reset
- stringifyArguments
- transport
- white
- yellow

### Methods

- error
- info
- log
- ok
- warn
- isNodeEnvironment
- isProductiveEnvironment

## Constructors

### constructor

- new Logger(transport?: Transport): Logger

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:69

  Instatiate an instance of logger

  #### Parameters

  - ##### Optional transport: Transport

    A transport instance that can be used for error transport

  #### Returns Logger

## Properties

### Private checkLogLevel

checkLogLevel: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:81

Check if intended log level is allowed in environment log level

param
returns

### Private cyan

cyan: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:21

Prefix for cyan color

### Private getLogLevel

getLogLevel: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:86

Return log level from environment

returns

### Private green

green: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:25

Prefix for green color

### Private isNode

isNode: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:29

Set to true if this code is executed by Node.js

### Private isProductiveEnvironment

isProductiveEnvironment: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:35

Set to true if the environment for a productive environment is given

In Node.js this means that `NODE_ENV` is set to `production`

### Private isTransportWithVerification

isTransportWithVerification: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:87

### Private logLevels

logLevels: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:39

Log levels

### Private red

red: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:43

Prefix for red color

### Private reset

reset: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:47

Suffix to end a color

### Private stringifyArguments

stringifyArguments: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:94

Stringify a list of arguments

param

  Arguments to stringify

returns

  Stringified arguments

### Private Optional transport

transport: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:53

Transport for errors

For example `@stapps/smtp-transport`

### Private white

white: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:57

Prefix for white color

### Private yellow

yellow: any

- Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:61

Prefix for yellow color

## Methods

### error

- error(...args: any[]): void

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:100

  Log with level ERROR

  #### Parameters

  - ##### Rest ...args: any[]

    Arguments to log

  #### Returns void

### info

- info(...args: any[]): void

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:106

  Log with level INFO

  #### Parameters

  - ##### Rest ...args: any[]

    Arguments to log

  #### Returns void

### log

- log(...args: any[]): void

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:112

  Log with level LOG

  #### Parameters

  - ##### Rest ...args: any[]

    Arguments to log

  #### Returns void

### ok

- ok(...args: any[]): void

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:118

  Log with level OK

  #### Parameters

  - ##### Rest ...args: any[]

    Arguments to log

  #### Returns void

### warn

- warn(...args: any[]): void

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:124

  Log with level WARN

  #### Parameters

  - ##### Rest ...args: any[]

    Arguments to log

  #### Returns void

### Static isNodeEnvironment

- isNodeEnvironment(): boolean

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:65

  Checks if this code is executed in Node.js

  #### Returns boolean

### Static isProductiveEnvironment

- isProductiveEnvironment(): boolean

- - Defined in node_modules/@openstapps/logger/lib/Logger.d.ts:69

  Checks if a productive environment is given

  #### Returns boolean

Generated using TypeDoc