![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.
@grahamcrackers/logger
Advanced tools
A naive logger for client side applications.
// src/logger.ts
import { createLogger, LogLevel } from "@grahamcrackers/logger";
export const logger = createLogger({
// defaults to LogLevel.Log or (0)
logLevel: LogLevel.Info,
});
Level | Enum | Description |
---|---|---|
Log | 0 | (Default) Logs all levels |
Info | 1 | Helpful for debugging in non prod environments |
Warn | 2 | Show console warnings |
Error | 3 | Show console errors |
I wanted a logger that I could log during development and if I forget to remove a console log because of reasons it won't output critical info if building for production.
I mainly use vite for front end apps these days so this example is using that setup. If you use webpack, you can translate the environment variables to your setup.
your local set up to log everything
VITE_LOG_LEVEL=0
VITE_LOGGING_ENABLED=true
set the log level in prod to only show warnings and errors, or set logging to be disabled entirely.
VITE_LOG_LEVEL=3
# or disable everything
VITE_LOGGING_ENABLED=false
// src/logger.ts
import { createLogger, LogLevel } from "@grahamcrackers/logger";
export const logger = createLogger({
isEnabled: import.meta.env.VITE_LOGGING_ENABLED,
logLevel: import.meta.env.VITE_LOG_LEVEL,
});
FAQs
A naive logger for client side applications.
The npm package @grahamcrackers/logger receives a total of 2 weekly downloads. As such, @grahamcrackers/logger popularity was classified as not popular.
We found that @grahamcrackers/logger demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
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.