
Product
Introducing GitHub Actions Scanning Support
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
@poap-xyz/poap-logger
Advanced tools
A logger with a simple facade to use in the POAP ecosystem.
The
main
branch is for version 2.x of the logger.
Version 1.x has its own branch.
Install from NPM repository. There are two implementations: winston
and pino
. Both work in the
same way, depending on which one you are using, install it alongside this package.
yarn add @poap-xyz/poap-logger winston
# OR
yarn add @poap-xyz/poap-logger pino
Use the factory to create new instances of a logger.
import { PoapLoggerFactory } from '@poap-xyz/poap-logger';
const logger = PoapLoggerFactory.createLoggerInstance({
metadata: {/*METADATA*/}
});
Where METADATA is a key value pair object where you add extra properties you want to log, eg:
const logger = PoapLoggerFactory.createLoggerInstance({
metadata: {
requestId: request.headers["requestid"],
requestUrl: request.url,
source: "POAP-Logger-Parent",
},
});
A minimum level can be set on creation. All logs that are lower priority than the given level will be discarted.
import { PoapLoggerLevel } from '@poap-xyz/poap-logger';
const logger = PoapLoggerFactory.createLoggerInstance({
level: PoapLoggerLevel.WARNING,
});
By default the implementation is going to be auto detected depending on the packages defined in
your package.json
but it can be overriden.
import { PoapLoggerType } from '@poap-xyz/poap-logger';
const logger = PoapLoggerFactory.createLoggerInstance({
type: PoapLoggerType.PINO_LOGGER,
});
Create a child logger to override or combine parent child metadata:
const newLogger = logger.child({
moreMetadata1: "More meta", // Will be added
source: "POAP-Logger-Child" // Will override parent's source prop
});
ISC © POAP
FAQs
A logger for POAP
We found that @poap-xyz/poap-logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 5 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.
Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.
Product
Add real-time Socket webhook events to your workflows to automatically receive pull request scan results and security alerts in real time.
Research
The Socket Threat Research Team uncovered malicious NuGet packages typosquatting the popular Nethereum project to steal wallet keys.