![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@gauntface/logger
Advanced tools
@gauntface/logger
is a simple library aimed at making it easy to add
colored and prefixed logs to a project in both Node and the browser.
<script src="https://unpkg.com/@gauntface/logger@3.0.2/build/browser-globals.js"></script>
<script>
console.log('\n\nThe following are the logs out of the box:\n\n\n');
// Use the default logger
gauntface.logger.debug(`console.debug()`);
gauntface.logger.info(`console.info()`);
gauntface.logger.log(`console.log()`);
gauntface.logger.warn(`console.warn()`);
gauntface.logger.error(`console.error()`);
console.log('\n\nYou can customize the prefix to something you\'ll recognize:\n\n\n');
// Customize the default loggers prefix
gauntface.logger.setPrefix(`Logger Demo`);
gauntface.logger.log('👋');
// Create your own logger instances
console.log('\n\nYou can create different instances of "Loggers":\n\n\n');
const simpleLogger = new gauntface.Logger({
prefix: 'My App/Demo',
});
simpleLogger.log(`Example message`, {
message: 'Works just like console.log()'
});
console.log('\n\nYou can also customize each log level prefix:\n\n\n')
// Use your own prefix for some or all of the log
// levels
const complexLogger = new gauntface.Logger({
prefix: {
[gauntface.LogLevels.GROUP]: 'My App/Groups',
[gauntface.LogLevels.ERROR]: '👻',
},
});
complexLogger.log('The logger lib supports groups');
complexLogger.group(`Like this one`);
complexLogger.log(`I'm nested`);
complexLogger.groupCollapsed(`You can collapse them too`);
complexLogger.error(`Boo`);
complexLogger.groupEnd();
complexLogger.groupEnd();
</script>
Using the default logger:
const {logger} = require('@gauntface/logger');
logger.debug(`console.debug()`);
logger.info(`console.info()`);
logger.log(`console.log()`);
logger.warn(`console.warn()`);
logger.error(`console.error()`);
// Customize the default loggers prefix
logger.setPrefix(`Logger Demo`);
logger.log('👋');
Using a custom logger
const {Logger} = require('@gauntface/logger');
const simpleLogger = new Logger({
prefix: 'My App/Demo',
});
simpleLogger.log(`Example message`, {
message: 'Works just like console.log()'
});
The package.json defines a main and a browser property which
should allow you to use @gauntface/logger
for importing, if
however you want to explicitly get the browser / node version
please use the following imports:
import {logger, Logger, ...} from '@gauntface/logger/src/browser/browser.js';
import {logger, Logger, ...} from '@gauntface/logger/src/node/node.js';
FAQs
A simple console abstraction with some little extras
The npm package @gauntface/logger receives a total of 0 weekly downloads. As such, @gauntface/logger popularity was classified as not popular.
We found that @gauntface/logger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.