hana-logflow-sdk
v1.0.1
Published
SDK for sending logs to LogFlow from any Node.js application
Downloads
303
Maintainers
Readme
logflow-sdk
Official SDK for sending logs to your LogFlow applications.
Installation
npm install logflow-sdkUsage
import { init, log } from 'logflow-sdk'
init({
apiKey: 'your-api-key',
appName: 'your-app-name',
baseURL: 'https://your-api-url.com' // optional, defaults to localhost:5000
})
await log('User signed up', 'INFO')
await log('Slow DB query detected', 'WARN')
await log('Payment service crashed', 'ERROR')Methods
init({ apiKey, appName, baseURL? })
Call this once at the start of your app.
log(message, level?)
Sends a log. Level defaults to 'INFO'. Options: 'INFO', 'WARN', 'ERROR'
