Skip to main content

No project description provided

Project description

How to publish to pypi

# set up pypi token
poetry config pypi-token.pypi my-token

# build the project
poetry build

# publish the project
poetry publish

# DONE

Generate source code from protobuf

$ poetry add grpcio-tools
$ poetry add grpcio
$ cd sfdevtools/
$ poetry run python -m grpc_tools.protoc -I ./grpc_protos --python_out=./grpc_protos/ --grpc_python_out=./grpc_protos/ ./grpc_protos/peacock.proto

Demo example

Double check lock for singleton

import sfdevtools.observability.log_helper as lh
import logging
logger = lh.init_logger(logger_name="sfdevtools_logger", is_json_output=False)
# create class X
class X(SDC):
    pass

# create class Y
class Y(SDC):
    pass

A1, A2 = X.instance(), X.instance()
B1, B2 = Y.instance(), Y.instance()

assert A1 is not B1
assert A1 is A2
assert B1 is B2

logger.info('A1 : {}'.format(A1))
logger.info('A2 : {}'.format(A2))
logger.info('B1 : {}'.format(B1))
logger.info('B2 : {}'.format(B2))

Send log to logstash

logger = lh.init_logger(logger_name="connection_tester_logger"
                        , is_json_output=False
                        , is_print_to_console=True
                        , is_print_to_logstash=True
                        , logstash_host="<the host name>"
                        , logstash_port=5960
                        , logstash_user_tags=["Test001", "Test002"])
logger.info("Test Message from test")
logger.error("Test Message from test")
logger.warning("Test Message from test")

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

sfdevtools-1.17.0.tar.gz (12.9 kB view details)

Uploaded Source

Built Distribution

sfdevtools-1.17.0-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

Details for the file sfdevtools-1.17.0.tar.gz.

File metadata

  • Download URL: sfdevtools-1.17.0.tar.gz
  • Upload date:
  • Size: 12.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.10 Linux/5.15.0-60-generic

File hashes

Hashes for sfdevtools-1.17.0.tar.gz
Algorithm Hash digest
SHA256 f4052814f5e48de90b24e85921ba58ad20c77fddd0939bf06a8d45793c74da30
MD5 ce893cd8adba6d28514ac26c659b8785
BLAKE2b-256 3c785eb9befde79dea9909d71eaf7b8091558a401b082aa8796d1b3776d26b62

See more details on using hashes here.

File details

Details for the file sfdevtools-1.17.0-py3-none-any.whl.

File metadata

  • Download URL: sfdevtools-1.17.0-py3-none-any.whl
  • Upload date:
  • Size: 20.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.1 CPython/3.8.10 Linux/5.15.0-60-generic

File hashes

Hashes for sfdevtools-1.17.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53029ea8605a076c63fd82c4f5fa24db1bd575bbffc839c3fe754a4d90b66f7b
MD5 7939a333b301d9ba7791d01700a83be9
BLAKE2b-256 39d3dba4ac0646f6d7880c66d0e53da2b87b0fb12e67e4195f0eb164bcff9a43

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page