Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ozmap/ozlogger
DevOZ logger module.
https://github.com/ozmap/ozlogger
logger nodejs typescript winston
Last synced: about 2 months ago
JSON representation
DevOZ logger module.
- Host: GitHub
- URL: https://github.com/ozmap/ozlogger
- Owner: ozmap
- License: mit
- Created: 2022-11-07T00:58:09.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-11T03:53:34.000Z (11 months ago)
- Last Synced: 2024-05-21T08:41:22.492Z (8 months ago)
- Topics: logger, nodejs, typescript, winston
- Language: TypeScript
- Homepage:
- Size: 729 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OZLogger
DevOZ logger module.----
## Available log methods
The available methods are presented in level hierarchy order.- `.debug(...messages: any[])`
- `.audit(...messages: any[])`
- `.info(...messages: any[])`
- `.warn(...messages: any[])`
- `.error(...messages: any[])`## Usage examples
Here is a simple code snippet example of using the OZLogger with typescript:```typescript
import createLogger from '@ozmap/logger';// Initialize and configure the logging facility
const OZLogger = createLogger();// Example of simple debug log
OZLogger.debug("Simple test log");
```If you are using the OZLogger with javascript:
```javascript
const createLogger = require('@ozmap/logger');// Initialize and configure the logging facility
const OZLogger = createLogger();// Example of simple debug log
OZLogger.debug("Simple test log");
```The above snippet can even be improved to:
```javascript
// Initialize and configure the logging facility right after importing it
const OZLogger = require('@ozmap/logger')();// Example of simple debug log
OZLogger.debug("Simple test log");
```## Changing log levels
In order to change the log level at runtime the following
HTTP request can be made:```
POST http://localhost:9898/changeLevel
{
"level": "",
"duration":
}
``````curl
curl -L -X POST -H 'Content-Type: application/json' -d '{"level":"","duration":}' http://localhost:9898/changeLevel
```