Code Monkey home page Code Monkey logo

yall's Introduction

yall

license Travis (.org) branch AppVeyor branch SonarQube Coverage SonarQube Tech Debt

yall is a subsystems based logging library. It allows to create subsystems which will manage all the logging parameters for an area of the application. Subsystems can inherit from one another, override parents parameters...

yall is available on Linux and Windows (MSVC12 and MSVC14).

How to use

Informations about how to use yall can be found on the project wiki.

The main workflow to use yall is the following:

  • Initialize the library
  • Create subsystems
  • Log messages

Build

Git LFS is required to clone the repository. yall use CMake as build system generator, so, ensure CMake is installed on your system (version 3.6 minimum). The following dependencies are also required :

  • gcc and g++.
  • pthread : a Windows version is available. Installed by default on Linux.
  • jansson : JSON parsing library.
  • doxygen : used to generate documentation.
  • criterion : available on Github. Used for unit testing. On Windows, it is available inside external folder.
  • valgrind (optional, Linux only) : some tests scripts use it to test the library.
  • rpmbuild and debbuild (optional, Linux only) : to generate Linux packages.
  • python-sphinx, python-sphinx-rtd-theme and breathe (optional, Linux) : to build the user documentation.

Then :

cmake -Bbuild -H. -DCMAKE_BUILD_TYPE=Release
make -C build

Launched inside the sources directory, these commands will create a build directory to run CMake inside, and build the library. The CMAKE_BUILD_TYPE variable will define what will be installed. Release here can be changed to Debug, to build the library with the debug symbols.

On Windows, the process is straightforward using CMake GUI and Visual Studio.

Installation

Once library is build, install it with :

sudo make -C build install

It requires sudo as the file are installed on the system in /usr/local.

Contribute

The way to contribute to the project is define is CONTRIBUTING.md (currently under development).

Troubleshooting

For any problem that can't be solved using Debugging section of the documentation, there is multiple solutions :

  • Send a mail to the maintainer : naccyde <at> naccyde <dot> eu.
  • Fork the repository and create a pull-request.

yall's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

yall's Issues

Set fixed size for subsystem name

appTest ::: NOTICE :: main :: 2017-01-26 17:45:47 : Starting application...

Set fixed name length for subsystem name ("appTest" here). The style of the generated output should be better.

Count references to the library

A problem occurs if a client closes yall before the other client have finished :

A: yall_init();
B: yall_init();
B: yall_close();
A: YALL_ERR(); -> Library is closed !

Create message queue to avoid locking

Create a lock free message queue which avoid locking the console or the file.

  • This queue must be emptied on closing.
  • Add message when writer thread is closed.

TODO :

  • Write unit tests

Change library license

Current license is GPLv2. The problem is that a closed sources project could not use the library, which is blocking. The currently most appropriate license is MIT.

Create a MSVC12 build

TODO :

  • Build Criterion (unit testing) for MSVC 12 : failed. Boxfort which is a depedency of Criterion does not support MSVC < 14
  • Run MSVC 12 build on AppVeyor

Show message line on log output

Instead of :
appTest ::: EMERGENCY :: main :: 2017-01-27 15:41:51 : ApplicationManager failed to initialize
get :
appTest ::: EMERGENCY :: main:186 :: 2017-01-27 15:41:51 : ApplicationManager failed to initialize

Replace subsystems linked list

The subsystems linked list is not the best way to manage the subsystems as it triggers cache misses when the library try to retrieve a subsystem. Using a plain array would be better, but we have to keep the subsystems hierarchy intact.

Issue #42 would work on the same parts of the code.

Refactor header generation

Header format should be customizable to allow different configurations, in a printf manner :
\s :: \d :: \f : will generate <subsystem> :: <date> :: <function> as header.

Empty the log files on each application run

Remove file in create_subsystem(), add a flag in struct yall_subsystem to find out if the file should be deleted on create but do not use it now (subsystem creation will be to heavy will this flag).

Create a log viewer

Create an application which will read a log file and a configuration, and show the subsystems tree and each log message.

Rewrite README.md

Clean README.md, set only useful informations and write library documentation inside the GitHub wiki.

Improve custom function call system

  • C++ version ?
  • Buffer size ? Let the caller define its own buffer size through malloc
  • Carriage return ?
  • Indent each line
  • Possibility to add text on the first line

Callback functions

Implement callback function for each subsystem, on each log level.
This will allow to call a specific custom function on each subsystem log for each log level (to open a confirmation popup for example).

UPDATE : This a more an "Error management" feature, than a "Logging" feature. It is currently out of scope.

Create a "default" subsystem in case of error

This subsystem will be defined inside the library and will be used in case of error, if a requested subsystem is not found. It should log data from debug to emerg in a specific file.

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.