Git Product home page Git Product logo

mrlog's Introduction

mrlog

mrlog (Machine Readable Log) is a utility used to create log messages that will be parsed by its sister program, mrreport.

Commands

Sections

Sections put bookends in the logs around a notable section.

The start and end of the section can be logged separately:

mrlog section-start --name="run-test"
test_runner execute
mrlog section-end --name="run-test" --result $? 

or combined:

mrlog section --name="run-test" \
      --on-failure="The test failed" \
      --on-success="The test passed" \
      -- test_runner execute

Examples

$ mrlog section --name="show-date" --on-success="successfully got the date" --on-failure="failed to get the date" -- date
section-start: 'show-date' MRL:{"type":"section-start","name":"show-date","time":"2021-02-22T13:21:40.132922-06:00"}
Mon Feb 22 13:21:40 CST 2021
section-end: 'show-date' result: 0 message: 'successfully got the date' MRL:{"type":"section-end","name":"show-date","time":"2021-02-22T13:21:40.137741-06:00","message":"successfully got the date"}

Dependency

mrlog has a built-in way of logging dependencies, useful in recording exact versions of other tools involved.

Examples

$ mrlog dependency --type binary --name kubectl --version $(kubectl version  --client -o json | jq -r .clientVersion.gitVersion)
binary dependency: 'kubectl' version 'v1.20.2' MRL:{"type":"binary dependency","version":"v1.20.2","name":"kubectl","metadata":"","time":"2021-02-22T13:30:34.213109-06:00"}

Developing

Utilize the Makefile for testing and building.

make test will execute the unit tests

make build will build the mrlog binary

mrlog's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar erniebilling avatar mboldt avatar petereltgroth avatar pivotal-so avatar squeedee avatar

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.