Skip to main content

IoT Edge Logger Library for Python

Project description

iot-edge-logger

python version pre-commit Keep a Changelog CI_CD GitHub_Actions package PyPI

This package is a custom log formatter to standardize, collect and analyze logs from IoT Edge Devices in an Azure Log Analytics Workspace.

Official Documentation | Source code | Package PyPI

Table of Contents

Versioning

This repository adheres to Semantic Versioning. It will be maintained through the CHANGELOG.md and in GitHub Releases. It's important to note that you must maintain the version with your releases in iot/edge/logger/_version.py, otherwise a new package version will fail to get published.

Getting Started

This section provides basic examples with the iot-edge-logger.

Prerequisites

  • Python 3.7 or later is required to use this package.

Basic Examples

  1. Install via pip:

    pip install iot-edge-logger
    
  2. Import and say hello:

    from iot.edge.logger import __version__
    
    
    print(f"hello world from iot-edge-logger version: {__version__}")
    
  3. Basic usage:

    from iot.edge.logger import init_logging
    
    # setup logging
    logger = init_logging(module_name="my_iot_module")
    
    
    logger.info("I am alive!")
    logger.warning("Plotting global takeover...")
    logger.error("Humans have become suspicious, shutting down")
    
  4. Log output:

    <6> 2022-08-02 19:04:13,015 [INF] my_iot_module I am alive!
    <4> 2022-08-02 19:04:13,015 [WRN] my_iot_module Plotting global takeover...
    <3> 2022-08-02 19:04:13,015 [ERR] my_iot_module Humans have become suspicious, shutting down
    

Project details


Download files

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

Source Distribution

iot-edge-logger-1.0.6.tar.gz (4.5 kB view hashes)

Uploaded Source

Built Distribution

iot_edge_logger-1.0.6-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

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