Skip to content

Python library for simplelogs logging system

Notifications You must be signed in to change notification settings

Se7ge/pysimplelogs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

Python library for simplelogs logging system

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages