Fyipe SDK

A fyipe sdk for application logger that can be used to send logs about your applications created on your fypie dashboard which can also used for error tracking

Installation

Gem Install

Via Gem

 gem install fyipe

Basic Usage for Logging

require 'fyipe'

# constructor
logger = FyipeLogger.new(
    'API_URL', # https://fyipe.com/api
    'APPLICATION_LOG_ID',
    'APPLICATION_LOG_KEY'
)


# Sending a string log to the server
item = 'This is a simple log'

response = logger.log(item)

# response after logging a request
puts response


# Sending an object log to the server
item = {
    "name" => "Tony Lewinsky",
    "location" => "Liverpool"
}

response = logger.log(item)
# response after logging a request
puts response

# alternatively, tags can be added to the logged item.
item = 'This is a simple log'
# using a tag string
tag = 'server-side-error'
response = logger.log(item, tag)
# response after logging a request
puts response

# Using an array of strings
tags = ['error', 'server']
response = logger.log(item, tags)
# response after logging a request
puts response

API Documentation

Main API to send logs to the server.

Author: HackerBay, Inc.

FyipeLogger.new(apiUrl, applicationId, applicationKey)

Create a constructor from the class, which will be used to send logs to the server.

Kind: Constructor Returns: null

Param Type Description
\apiUrl string The Server URL.
\applicationId string The Application Log ID.
\applicationKey string The Application Log Key.

logger.log(log, \tags)

Logs a request of type info to the server.

Kind: method of FyipeLogger.new Returns: Object - An object response of a success or failure.

Param Type Description
\log string \ Object
\tags string \ Array

logger.warning(warning, \tags)

Logs a request of type warning to the server.

Kind: method of FyipeLogger.new Returns: Object - An object response of a success or failure.

Param Type Description
\warning string \ Object
\tags string \ Array

logger.error(error, \tags)

Logs a request of type error to the server.

Kind: method of FyipeLogger.new Returns: Object - An object response of a success or failure.

Param Type Description
\error string \ Object
\tags string \ Array

Contribution

  • Clone repository
  • run cd ruby-sdk/fyipe
  • run bundle install to install dependencies
  • run bundle exec rspec to run tests