Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@openstapps/logger
Advanced tools
A cli logger with colors, loglevels and the possibility to use a transport system for errors
This is a simple logger for TypeScript projects with transformations for the log output.
Logs are only printed if their log level is equal or higher than the defined log level.
Available log levels are:
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
.
Additionally setting the environment variable STAPPS_EXIT_LEVEL
which works in the same manner as STAPPS_LOG_LEVEL
will terminate your process after logging at the selected level(s) (usefull for integration tests). It will be ignored in afore mentioned productive environments.
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.
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:
true
to enable tlsBy default the logger will only add the log level to the message.
You can change this behavior by setting other Transformers via Logger.setTransformations
. If you do so, mind the order of the transformers.
You may choose from the following:
AddLogLevel
, which prepends the output with the log levelColorize
, which colorizes the output according to the log levelTimestamp
, which prepends a timestamp to the outputFAQs
A cli logger with colors, log-levels and the possibility to use a transport system for errors
We found that @openstapps/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.