0.2.0 • Published 3 years ago

universal-loggly v0.2.0

Weekly downloads
1
License
MIT
Repository
github
Last release
3 years ago

universal-loggly

feature

  • send log to Loggly

how to install

  • yarn add universal-loggly

include example

  • vi /your-project/app.js
  // for library
  import { LogglyClient } from 'universal-loggly';

  // you can custom myself helper
  export function factoryLogglyClient() {
    return new LogglyClient(`<loggly host>`, 'token', 'secret')
  }

sample code

import { factoryLogglyClient } from 'universal-loggly-helper';

const logger = factoryLogglyClient();
const message = 'test message';
const redirectUrl = 'https://duckduckgo.com/';
const promise = logger.info(message, {
  extend_content: true,
});

promise.then(function(data) {
  // success
})
.catch(function(error) {
  console.error(`[universal-loggly]: ${error}`);
})
.finally(function() {
  window.location.href = redirectUrl;
});

plan of future

  • storage cookie
  • send hook
0.2.0

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago