mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-01-16 23:00:51 +00:00
remove build + update git ignore
This commit is contained in:
parent
cad91550e5
commit
61ec413de0
11 changed files with 3 additions and 112 deletions
3
python-sdk/.gitignore
vendored
3
python-sdk/.gitignore
vendored
|
|
@ -1 +1,4 @@
|
|||
*.pyc
|
||||
build/
|
||||
dist/
|
||||
fyipe_sdk/*.egg-info
|
||||
|
|
@ -1,71 +0,0 @@
|
|||
import requests
|
||||
from fyipe_sdk.logtype import LogType
|
||||
|
||||
|
||||
class FyipeLogger:
|
||||
def __init__(self, apiUrl, applicationLogId, applicationLogKey):
|
||||
self.applicationLogId = applicationLogId
|
||||
self.applicationLogKey = applicationLogKey
|
||||
self.apiUrl = apiUrl + "/application-log/" + applicationLogId + "/log"
|
||||
|
||||
def log(self, data, tags=None):
|
||||
"""
|
||||
Sends a log with type info
|
||||
"""
|
||||
|
||||
# validate the data is of type string or type object/dictionary
|
||||
if isinstance(data, (str, dict)) != True:
|
||||
return "Invalid Content to be logged"
|
||||
|
||||
# if a tag is passed, validate that it is of type string or array/list
|
||||
if tags is not None:
|
||||
if isinstance(tags, (str, list)) != True:
|
||||
return "Invalid Content Tags to be logged"
|
||||
# make request to the API
|
||||
return self._makeApiRequest_(data, LogType.INFO, tags)
|
||||
|
||||
def warning(self, data, tags=None):
|
||||
"""
|
||||
Sends a log with type warning
|
||||
"""
|
||||
|
||||
# validate the data is of type string or type object/dictionary
|
||||
if isinstance(data, (str, dict)) != True:
|
||||
return "Invalid Content to be logged"
|
||||
|
||||
# if a tag is passed, validate that it is of type string or array/list
|
||||
if tags is not None:
|
||||
if isinstance(tags, (str, list)) != True:
|
||||
return "Invalid Content Tags to be logged"
|
||||
|
||||
# make request to the API
|
||||
return self._makeApiRequest_(data, LogType.WARNING, tags)
|
||||
|
||||
def error(self, data, tags=None):
|
||||
"""
|
||||
Sends a log with type error
|
||||
"""
|
||||
|
||||
# validate the data is of type string or type object/dictionary
|
||||
if isinstance(data, (str, dict)) != True:
|
||||
return "Invalid Content to be logged"
|
||||
|
||||
# if a tag is passed, validate that it is of type string or array/list
|
||||
if tags is not None:
|
||||
if isinstance(tags, (str, list)) != True:
|
||||
return "Invalid Content Tags to be logged"
|
||||
|
||||
# make request to the API
|
||||
return self._makeApiRequest_(data, LogType.ERROR, tags)
|
||||
|
||||
def _makeApiRequest_(self, content, logType, tags):
|
||||
data = {
|
||||
"content": content,
|
||||
"applicationLogKey": self.applicationLogKey,
|
||||
"type": logType,
|
||||
}
|
||||
if tags is not None:
|
||||
data["tags"] = tags
|
||||
|
||||
response = requests.post(self.apiUrl, json=data)
|
||||
return response.json()
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
class LogType:
|
||||
INFO = "info"
|
||||
WARNING = "warning"
|
||||
ERROR = "error"
|
||||
BIN
python-sdk/dist/fyipe_sdk-1.0.0-py3-none-any.whl
vendored
BIN
python-sdk/dist/fyipe_sdk-1.0.0-py3-none-any.whl
vendored
Binary file not shown.
BIN
python-sdk/dist/fyipe_sdk-1.0.0.tar.gz
vendored
BIN
python-sdk/dist/fyipe_sdk-1.0.0.tar.gz
vendored
Binary file not shown.
|
|
@ -1,21 +0,0 @@
|
|||
Metadata-Version: 2.1
|
||||
Name: fyipe-sdk
|
||||
Version: 1.0.0
|
||||
Summary: A Fyipe package that tracks error event and send logs from your applications to your fyipe dashboard.
|
||||
Home-page: https://github.com/Fyipe/python-sdk
|
||||
Author: HackerBay, Inc.
|
||||
Author-email: hello@hackerbay.io
|
||||
License: UNKNOWN
|
||||
Project-URL: Bug Tracker, https://github.com/Fyipe/python-sdk/issues
|
||||
Description: # 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
|
||||
|
||||
Platform: UNKNOWN
|
||||
Classifier: Programming Language :: Python :: 3
|
||||
Classifier: License :: OSI Approved :: MIT License
|
||||
Classifier: Operating System :: OS Independent
|
||||
Requires-Python: >=3.6
|
||||
Description-Content-Type: text/markdown
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
README.md
|
||||
pyproject.toml
|
||||
setup.cfg
|
||||
setup.py
|
||||
fyipe_sdk/fyipe_sdk/__init__.py
|
||||
fyipe_sdk/fyipe_sdk/logger.py
|
||||
fyipe_sdk/fyipe_sdk/logtype.py
|
||||
fyipe_sdk/fyipe_sdk.egg-info/PKG-INFO
|
||||
fyipe_sdk/fyipe_sdk.egg-info/SOURCES.txt
|
||||
fyipe_sdk/fyipe_sdk.egg-info/dependency_links.txt
|
||||
fyipe_sdk/fyipe_sdk.egg-info/requires.txt
|
||||
fyipe_sdk/fyipe_sdk.egg-info/top_level.txt
|
||||
|
|
@ -1 +0,0 @@
|
|||
|
||||
|
|
@ -1,2 +0,0 @@
|
|||
requests
|
||||
faker
|
||||
|
|
@ -1 +0,0 @@
|
|||
fyipe_sdk
|
||||
Loading…
Add table
Reference in a new issue