https://github.com/christophhu/ngx-log-mode
The ngx-log-mode repostory is a demo application of the ngx-log-mode library. The library adds a simple toggle-component to activate or deactivate the log-mode of your application. It is possible to configure the log-level and log-mode (console, localstorage, sessionstorage or webAPI).
https://github.com/christophhu/ngx-log-mode
angular console demo localstorage logging ngx webapi
Last synced: 4 months ago
JSON representation
The ngx-log-mode repostory is a demo application of the ngx-log-mode library. The library adds a simple toggle-component to activate or deactivate the log-mode of your application. It is possible to configure the log-level and log-mode (console, localstorage, sessionstorage or webAPI).
- Host: GitHub
- URL: https://github.com/christophhu/ngx-log-mode
- Owner: ChristophHu
- License: mit
- Created: 2025-02-17T09:22:00.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-22T12:28:31.000Z (about 1 year ago)
- Last Synced: 2025-07-08T03:16:05.549Z (12 months ago)
- Topics: angular, console, demo, localstorage, logging, ngx, webapi
- Language: TypeScript
- Homepage: https://christophhu.github.io/ngx-log-mode/
- Size: 393 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Ngx-Log-Mode
## Frameworks and Languages


## Demo
## Description
This Repository is a demo application for the ngx-log-mode library. The ngx-log-mode library is a simple logger for Angular applications. It provides a simple API to log messages to the console, localstorage or to a customizable RestAPI. The library is easy to use and can be installed via [npm](https://www.npmjs.com/package/@christophhu/ngx-log-mode).
## Installation
To run this project, you need to have Node.js installed on your machine. Clone the repository and run the following commands:
```bash
npm i @christophhu/ngx-log-mode
```
## Use
### With default toggle
```html
```
### With custom toggle
```html
```
```typescript
import { LogDecorator, LogModeComponent, LogService } from '@christophhu/ngx-log-mode'
@Component({
...
imports: [
LogModeComponent
],
providers: [
LogService
]
})
export class TestComponent {
private _logService: LogService
constructor(@Inject(LogService) _logService: LogService) {
this._logService = _logService
}
// Log-Decorator to log the function call and the result with timestamp
@LogDecorator({ logType: 'info', input: false, output: false, timestamp: true })
toggleLog() {
this._logService.toggleLogActivate()
}
isLogActivated(): boolean {
return this._logService.isLogActivated()
}
logThis(param: string): void {
LogService.log('TemplateComponent', 'logThis()', ' param: ' + param)
}
logThis() {
LogService.debug('TemplateComponent', 'logDebug()')
LogService.info('TemplateComponent', 'logInfo()')
LogService.warn('TemplateComponent', 'logWarn()')
LogService.error('TemplateComponent', 'logError()')
LogService.fatal('TemplateComponent', 'logFatal()')
}
}
```
