Skip to main content

Longleding Operation Log Service SDK

Supported Python Versions

Python >= 3.6

Installation

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 = {
        "time": datetime.now(),
        "topic": "tpc",
        "tags": {"tg1": "v1", "tg2": "v2"},
        "content": "say something."
    }
    operation_log_service.log(**log)


def get_logs():
    end_time = datetime.now()
    start_time = datetime.strptime(("%d-%02d-%02d 00:00:00" % (end_time.year, end_time.month, end_time.day)), "%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))
    print("\n================================\n")
    resp = operation_log_service.get_operation_logs(**request)
    print(resp.total)
    for v in resp.logs:
        print(v)


if __name__ == '__main__':
    put_log()
    get_logs()

Metadata

Release files for longleding-operation-log-service-sdk 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for longleding-operation-log-service-sdk 0.3.0
File Size Uploaded Provenance
longleding-operation-log-service-sdk-0.3.0.tar.gz 8.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for longleding-operation-log-service-sdk 0.3.0
File Interpreter ABI Platform
longleding_operation_log_service_sdk-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 31.3 kB

Release files / longleding-operation-log-service-sdk-0.3.0.tar.gz

Download URL longleding-operation-log-service-sdk-0.3.0.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
6f64115f46fa1d9cca1628b6c8ce1940e413fd66316c5a1be88b21f26aaf3bcb
BLAKE2b-256 checksum
How to use checksums
f04ef4149833695dff0eac82fc9cea23782a1efc293fa7851de45e8c22a377c7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Release files / longleding_operation_log_service_sdk-0.3.0-py3-none-any.whl

Download URL longleding_operation_log_service_sdk-0.3.0-py3-none-any.whl
Size 23.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0f4f6001060d9ac9c4864e2f71719eb9d9fef48bb768677773a08a6bd0a71d51
BLAKE2b-256 checksum
How to use checksums
2a07dceb867ca5647dfd5d23879553b542fbc7c8e4e680190b094976af886ed0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.2

Security for longleding-operation-log-service-sdk 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page