Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@onflow/util-logger
Advanced tools
Logger for FCL-JS.
npm install --save @onflow/util-logger
Name | Value |
---|---|
error | 1 |
warn | 2 |
log | 3 |
info | 4 |
debug | 5 |
import * as logger from "@onflow/util-logger"
// This will fire if the config "logger.level" value is set to the error level or above
logger.log({
title: "Title of error",
message: "Message body",
level: logger.LEVELS.error
})
This package also exposes a useful method for logging deprecation warnings via log.deprecate
. The function accepts an object with the following keys as its parameters.
pkg
(optional) - The package which the deprecated feature belongs to (i.e. FCL/SDK
, @onflow/util-invariant
, etc.). If not provided it defaults to an empty string and will not show in the notice.subject
(optional) - The feature that is being deprecated (i.e. "Passing a start and end into getEvents"
).transition
(optional) - The URL to the transition guide for the deprecationlevel
(optional) - The logger level of the deprecation notice (default LEVELS.warn)message
(optional) - An additional message to provide the user about the deprecation. Will apcallback
(optional) -Deprecation notice format:
`${pkg} Deprecation Notice
============================
${subject} is deprecated and will cease to work in future releases of ${pkg}.
${message}
You can learn more (including a guide on common transition paths) here: ${transition}
============================`
The lines with subject
, message
, and transition
will not appear if these values are not provided.
Example usage:
import * as logger from "@onflow/util-logger"
logger.log.deprecate({
pkg: "FCL/SDK",
subject: "Passing a start and end into getEvents",
transition:
"https://github.com/onflow/flow-js-sdk/blob/master/packages/sdk/TRANSITIONS.md#0005-deprecate-start-end-get-events-builder",
})
FAQs
Logger for FCL-JS
The npm package @onflow/util-logger receives a total of 12,082 weekly downloads. As such, @onflow/util-logger popularity was classified as popular.
We found that @onflow/util-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 13 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.