oneuptime/python-sdk
2021-11-24 08:42:40 +01:00
..
fyipe_sdk fix python sdk test 2021-07-02 07:21:19 +01:00
.gitignore remove build + update git ignore 2021-04-21 11:02:03 +01:00
LICENSE set up updated 2021-04-15 11:11:32 +01:00
pyproject.toml config update 2021-04-15 16:28:00 +01:00
README.md change fyipe to oneuptime and fyipe.com to oneuptime.com project wide 2021-11-24 08:42:40 +01:00
README.rst change fyipe to oneuptime and fyipe.com to oneuptime.com project wide 2021-11-24 08:42:40 +01:00
requirements.txt functool removed 2021-04-21 11:12:21 +01:00
setup.cfg folder restucture + first build 2021-04-21 11:00:43 +01:00
setup.py lik update 2021-04-23 19:04:34 +01:00

OneUptime SDK

A oneuptime 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

Usage

Usage can be found at Examples and Usage

API Documentation

Main API to send logs to the server.

Author: HackerBay, Inc.

FyipeLogger(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 Returns: Object - An object response of a success or failure.

Param Type Description
log string | Object The content to the logged on the server.
tags string | Array The tag(s) to be attached to the logged item on the server.

logger.warning(warning, tags)

Logs a request of type warning to the server.

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

Param Type Description
warning string | Object The content to the logged on the server.
tags string | Array The tag(s) to be attached to the logged item on the server.

logger.error(error, tags)

Logs a request of type error to the server.

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

Param Type Description
error string | Object The content to the logged on the server.
tags string | Array The tag(s) to be attached to the logged item on the server.

FyipeTracker(apiUrl, errorTrackerId, errorTrackerKey)

Create a constructor from the class, which will be used to track errors sent to the server.

Kind: Constructor Returns: null

Param Type Description
apiUrl string The Server URL.
errorTrackerId string The Error Tracker ID.
errorTrackerKey string The Error Tracker Key.
option object The options to be considred by the tracker.

options

Param Type Description
maxTimeline int The total amount of timeline that should be captured, defaults to 5
captureCodeSnippet boolean When set as True stack traces are automatically attached to all error sent to your fyipe dashboard.

tracker.setTag(key, value)

Set tag for the error to be sent to the server.

Kind: method of FyipeTracker Returns: null

Param Type Description
key string The key for the tag.
value string The value for the tag.

tracker.setTags([{key, value}])

Set multiple tags for the error to be sent to the server. Takes in a list

Kind: method of FyipeTracker Returns: null

Param Type Description
key string The key for the tag.
value string The value for the tag.

tracker.setFingerprint(fingerprint)

Set fingerprint for the next error to be captured.

Kind: method of FyipeTracker Returns: null

Param Type Description
fingerprint string | list of strings The set of string used to group error messages on the server.

tracker.addToTimeline(category, content, type)

Add a custom timeline element to the next error to be sent to the server

Kind: method of FyipeTracker Returns: null

Param Type Description
category string The category of the timeline event.
content string | dict The content of the timeline event.
type string The type of timeline event.

tracker.captureMessage(message)

Capture a custom error message to be sent to the server

Kind: method of FyipeTracker Returns: Promise

Param Type Description
message string The message to be sent to the server.

tracker.captureException(error)

Capture a custom error object to be sent to the server

Kind: method of FyipeTracker Returns: Promise

Param Type Description
error Exception object The Error Object to be sent to the server.

Contribution

  • Clone repository
  • run pip install -r requirements.txt to install dependencies
  • run python -m unittest discover -s fyipe_sdk/tests to run tests