Git Product home page Git Product logo

vlt's Introduction

VLT - A Variant of Bolt OCaml Logging Tool

Overview

This package provides yet another variant of Bolt OCaml logging tool called VLT derived from Volt logging tool. Unlike Volt, VLT relies on ppx instead of camlp4 to preprocess source code. In addition to the original Bolt (except preprocessor), VLT offers the following features:

  • Pass filter concept Each logger has an associated pass filter, which ensures that events will never be propagated to the ancestor loggers when the events do not satisfy the filter.

  • Original logging syntax modified for ppx
    log_expr ::= [%LOG level (string|ident) {arg}* {attr}* ]

    level ::=
    | [%FATAL]
    | [%ERROR]
    | [%WARN]
    | [%INFO]
    | [%DEBUG]
    | [%TRACE]

    attr ::=
    | [%NAME string ]
    | [%(PROPERTIES | WITH) expr ]
    | [%(EXCEPTION | EXN) expr ]

  • Extended logging syntax
    log_expr ::= ...
    | [%fatal_log (string|ident) {arg}* {attr}* ]
    | [%error_log (string|ident) {arg}* {attr}* ]
    | [%warn_log (string|ident) {arg}* {attr}* ]
    | [%info_log (string|ident) {arg}* {attr}* ]
    | [%debug_log (string|ident) {arg}* {attr}* ]
    | [%trace_log (string|ident) {arg}* {attr}* ]

    block_expr ::=
    | begin%fatal_block expr_seq end
    | begin%error_block expr_seq end
    | begin%warn_block expr_seq end
    | begin%info_block expr_seq end
    | begin%debug_block expr_seq end
    | begin%trace_block expr_seq end

  • More informative default logger name In addition to a capitalized source file name without suffix, surrounding module names, class names, method names, or function names are used to compute a logger name, unless [%NAME ... ] attribute is provided. Note that, unlike Volt, you have to enclose each toplevel structure_item in [%%capture_path ... ].

  • Suppression of unwanted evaluation of arguments Arguments in the [%LOG ... ] and *_log expressions are not evaluated when the defined logger does not record events.

  • Additional keys for use by the pattern and csv layouts.
    monthname - name of month e.g. January, February, ...
    monthnm - abbreviated name of month e.g. Jan, Feb, ...

Sources

The development sources are available from GitHub.

License

As in the original version, this tool is free software released under the LGPLv3.

Installation

$ dune build
$ dune install

Original

The original Bolt is Copyright (C) 2009-2012 Xavier Clerc and released under the LGPLv3. The official website of Bolt is here.


Copyright © 2023 Codinuum Software Lab

vlt's People

Contributors

codinuum avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

kit-ty-kate

vlt's Issues

Tests failure on OCaml 5.2

The current version of vlt fails in the tests when using OCaml 5.2:

#=== ERROR while compiling vlt.0.1 ============================================#
# context              2.2.0~beta2~dev | linux/x86_64 | ocaml-variants.5.2.0+trunk | file:///home/opam/opam-repository
# path                 ~/.opam/5.2/.opam-switch/build/vlt.0.1
# command              ~/.opam/5.2/bin/dune runtest -p vlt -j 1
# exit-code            1
# env-file             ~/.opam/log/vlt-308-3f8587.env
# output-file          ~/.opam/log/vlt-308-3f8587.out
### output ###
# File "test/orig/01-syntax/daikon.t/run.t", line 1, characters 0-0:
# /usr/bin/git --no-pager diff --no-index --color=always -u _build/.sandbox/12426a727b4d3fdd6bf56e942a6a4eec/default/test/orig/01-syntax/daikon.t/run.t _build/.sandbox/12426a727b4d3fdd6bf56e942a6a4eec/default/test/orig/01-syntax/daikon.t/run.t.corrected
# diff --git a/_build/.sandbox/12426a727b4d3fdd6bf56e942a6a4eec/default/test/orig/01-syntax/daikon.t/run.t b/_build/.sandbox/12426a727b4d3fdd6bf56e942a6a4eec/default/test/orig/01-syntax/daikon.t/run.t.corrected
# index eb08424..bf11928 100644
# --- a/_build/.sandbox/12426a727b4d3fdd6bf56e942a6a4eec/default/test/orig/01-syntax/daikon.t/run.t
# +++ b/_build/.sandbox/12426a727b4d3fdd6bf56e942a6a4eec/default/test/orig/01-syntax/daikon.t/run.t.corrected
# @@ -4,7 +4,8 @@ Instrument with vlt.ppx:
#      {
#        tool_name = "ppx_driver";
#        include_dirs = [];
# -      load_path = [];
# +      hidden_include_dirs = [];
# +      load_path = ([], []);
#        open_modules = [];
#        for_package = None;
#        debug = false;

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.