Git Product home page Git Product logo

wryte's People

Contributors

dependabot[bot] avatar nir0s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

wryte's Issues

Support child loggers

Instead of having to provide a plethora of fields every time something happens, it would make sense to allow to create child loggers consisting of permanent fields:

wryte = Wryte()
new_wryte = wryte.child({'key1': 'value1'})
new_wryte.info(...)
...

new_wryte will include the key1 field for every log message it generates.

Consider support for additional handlers (configurable via env vars)

Support a context id for moving logs between workflows

Let's say that you just received a login event (e.g. wryte.info('User Logged In)).
You would now like to follow up that that event throughout its logs (db connections, etc..).

It would be good to allow to bind an auto-generated context_id which will follow the event until it finishes and then lose the id.

Add a flag to print bare console logs

The current default format is timestamp - name - level - message. We should allow to simply log message by providing a flag when instantiating the logger.

Support optional stack call context fields

We can use the logger.findCaller() method to retrieve stack information.

This should be configurable via WRYTE_INCLUDE_SRC and a method flag and should be documented that it shouldn't be used in production as it degrades performance greatly.

Support exception logging

It would be nice to support automated delivery of exceptions, nicely formatted, when an exception object is passed to the logger.

Add some documentation

on:

  • Logger hierarchy
  • Reserved fields
  • Examples on how to provide log objects (key=value, multiple-dicts, nested dicts, etc..)
  • Reorganize the docs to be much clearer.

Simple should write kv pairs on the same line

When using the simple flag, Wryte should output kv pairs like so:

2018-04-10T21:58:53.682506 - Wryte - INFO - w00t - key1=value1 key2=value2

Pros:

Single line log messages

Cons:

May overflow a single line and then be half readable

Allow to send event

An event implies that "Something applicative happened now". e.g. user logged in or credit card transaction made.

It would be useful to add a type field which will default to type=log. When sending an event via wryte.event, it can append a type=event kv instead. This will allow users to search only on events instead of their context (the logs).

Supporting configuring wryte via env vars

Much like Grafana's env-var based configuration, it would be nice to support configuring wryte via environment variables.

For instance:

WRYTE_LOGGER_NAME_aggr_elasticsearch_endpoint would configure the logger named LOGGER_NAME to emit JSON formatted logs to the endpoint provided.

Like so:

WRYTE_LOGGER_NAME_console_enabled
WRYTE_LOGGER_NAME_console_level
WRYTE_LOGGER_NAME_aggr_elasticsearch_endpoint # implicit enablement
WRYTE_LOGGER_NAME_aggr_elasticsearch_level
WRYTE_LOGGER_NAME_aggr_logzio_enabled # implicit enablement
WRYTE_LOGGER_NAME_aggr_logzio_level
WRYTE_LOGGER_NAME_aggr_logzio_token
...

Consider not using a level conversion table

To increase performance, maybe a conversion table for severity levels can be avoided and the user should take the hit if providing a wrongly named level (uppercase, lowercase, etc..)

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.