
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
rfx-logger
Advanced tools
Upgrade for browser console messages
Install the npm package:
npm install rfx-logger
.config
is optionalimport { RfxLoggerModule, RfxLoggerInterceptor } from 'rfx-logger';
import { HTTP_INTERCEPTORS } from '@angular/common/http';
@NgModule({
imports: [
RfxLoggerModule.config({
[ ... ]
})
],
providers: [
{
provide: HTTP_INTERCEPTORS,
useClass: RfxLoggerInterceptor,
multi: true
}
],
})
disableLogger
(default false
)If true, completely disable all types of messages
disableVerbose
(default false
)When this option is set to true, logger doesn't print any debug data, just a one line message
disableHttpCodes
disableHttpCallDuration
disableTime
devEnabledLogs
prodEnabledLogs
colorsConfig
You can customize every message tag, text, time and http response time
This is the default style:
colorsConfig: [
{
logType: 'success',
textStyle: 'color: #8BC34A; font-weight: bold; padding: 1px 0;',
tagStyle: 'color: #000000; font-weight: bold; background-color: #8BC34A; padding: 1px 5px;',
timeStyle: 'color: #9E9E9E; padding: 1px 0;',
responseTimeStyle: 'color: #9E9E9E; padding: 1px 0;'
},
{
logType: 'warning',
textStyle: 'color: #FFC107; font-weight: bold; padding: 1px 0;',
tagStyle: 'color: #000000; font-weight: bold; background-color: #FFC107; padding: 1px 5px;',
timeStyle: 'color: #9E9E9E; padding: 1px 0;',
responseTimeStyle: 'color: #9E9E9E; padding: 1px 0;'
},
{
logType: 'error',
textStyle: 'color: #F44336; font-weight: bold; padding: 1px 0;',
tagStyle: 'color: #FFFFFF; font-weight: bold; background-color: #F44336; padding: 1px 5px;',
timeStyle: 'color: #9E9E9E; padding: 1px 0;',
responseTimeStyle: 'color: #9E9E9E; padding: 1px 0;'
},
{
logType: 'trace',
textStyle: 'color: #BDBDBD; font-weight: bold; padding: 1px 0;',
tagStyle: 'color: #FFFFFF; font-weight: bold; background-color: #757575; padding: 1px 5px;',
timeStyle: 'color: #9E9E9E; padding: 1px 0;',
responseTimeStyle: 'color: #9E9E9E; padding: 1px 0;'
}
]
import { RfxLoggerService } from 'rfx-logger';
[...]
constructor(rfxLoggerService: RfxLoggerService) { }
[...]
this.rfxLoggerService.success(message, data); // success - green message
this.rfxLoggerService.warning(message, data); // warning - yellow message
this.rfxLoggerService.error(message, data); // error - red message
this.rfxLoggerService.trace(message, data); // trace - gray message
https://demo.redfoxxo.dev/rfx-logger
This project is licensed under the MIT License
FAQs
RfxLogger - upgrade your browser console messages
The npm package rfx-logger receives a total of 3 weekly downloads. As such, rfx-logger popularity was classified as not popular.
We found that rfx-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
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.