GithubHelp home page GithubHelp logo

pysimplelogs's Introduction

Version: 0.3.2

About

pysimplelogs is a python client library for [Simplelogs] sl logging system.

Requirements

Config-file description

Before using this lib in your code, please change settings in config.py:

SLEEP_TIME = 0.1  # Time between attempts for sending log entry.
NUMBER_OF_ATTEMPTS = 5  # Attempts.
CONNECTION_TIMEOUT = 3  # Connections timeout in seconds.

How to use

Very simple!

from pysimplelogs import Simplelog
simplelog = Simplelog("http://hostname/")
simplelog.warning({'ip': '127.0.0.1', 'name': 'Jon'}, "Hello, world!", ["core", "client"])

Message format:

simplelog.level-name(owner, data, tags)

Description:

  • level-name - any level, that server returns by URI http://host/api/level/. It can be customized in [simplelogs] sl config-file.
  • owner - entry owner. String or dictionary. [Required]
  • data - entry owner. String or dictionary. [Required]
  • tags - list only.

What's new

0.3.2

  • If asynchronous send not allowed, make the synchronous one.

0.3.1

  • Fix in datetime JSONEncoding,
  • Added skip parameter for possibility to use pagination.

0.3.0

  • Logger class. Now you can use pysimplelogs like standard python logger.

0.2.3

  • Refactoring and bugfixes.

0.2.1

  • Added json-encoder for datetime objects serialization.
  • Bugfixes.

0.2.0

  • Methods for getting data;
  • Added requirements.txt.

0.1.1

  • If server is not available, default levels list will be initialized: critical, error, warning, notice, info, debug;
  • Server URL was deleted from config-file. Now you need to create instance. I recommend you to write 1 function for it. DRY.

pysimplelogs's People

Contributors

curiousdima avatar se7ge avatar

Watchers

 avatar  avatar

Forkers

hitsl

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.