Skip to main content

Longleding Operation Log Service SDK

Project description

Longleding Operation Log Service SDK

Supported Python Versions

Python >= 3.6


longleding-operation-log-service-sdk is available for Linux, macOS, and Windows.

$ pip install longleding-operation-log-service-sdk

Basic Usage

# -*- coding: utf-8 -*-
from datetime import datetime
import operation_log_service

log_service_endpoint = "localhost:80"
source_name = "demo"

operation_log_service.init_service(endpoint=log_service_endpoint, src=source_name)

def put_log():
    log = {
        "topic": "tpc",
        "tags": {"tg1": "v1", "tg2": "v2"},
        "content": "say something."

def get_logs():
    end_time =
    start_time = datetime.strptime(("%d-%02d-%02d 00:00:00" % (end_time.year, end_time.month,, "%Y-%m-%d %H:%M:%S")
    request = {
        "start_time": start_time,
        "end_time": end_time,
        "offset": 0,
        "limit": 0,
        "reverse": False,
        "topic_in": ["tpc", "other"],
        "source_in": ["demo", "other"],
        "tag_contains": {
            "tg1": ["v1", "v8"],
            "tg2": [],
    print("request: " + str(request))
    resp = operation_log_service.get_operation_logs(**request)
    for v in resp.logs:

if __name__ == '__main__':

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for longleding-operation-log-service-sdk, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size longleding_operation_log_service_sdk-0.3.0-py3-none-any.whl (23.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size longleding-operation-log-service-sdk-0.3.0.tar.gz (8.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page