Giter Site home page Giter Site logo

wat's Introduction

WAT Library

Yet another C++ logging library for troubleshooting purposes.

Currently supports:

  • Windows, Linux, MacOS
  • Windows: VS 2008+
  • Can use BOOST or cxx17 (see whathappened_lib/wat_config.h)

How to use:

1. Instrument your code:

Init the library and use scoped and other events in the code:

        #include "wat_lib.h"
        
        // how to init the lib
        wat::lib_auto lib(file_name_hint);

        // version 1
        // declare scoped event
        WAT_DEF_SCOPED_EVENT(evt2)
                WAT_PARAM("number=") 
                WAT_PARAM((unsigned long long)42)
            WAT_END;

        // version 2
        wat::public_event evt(__FUNCTION__, "number=",1);

See do_selftest function from the sample how to fire the events:

src\whathappened\main.cpp

2. How to disable the instumentation or to configure the library:

See: src\whathappened_lib\wat_config.h

3. How to analyze the logs

Run:

 whathappened /report <report file> <log file> <yyyy/mm/dd hh:mm:ss:SSS>

It shows the state of the thread on this point:

REPORT AT [2021/03/21 13:18:00:060]

THREAD 1ae2
[do_selftest|pool thread|very important]
       [00000002][2021/03/21 13:17:59:960]  [do_selftest|evt2|number=2] [100]
       [00000001][2021/03/21 13:17:59:960]  [do_selftest|number=1] [100]

wat's People

Contributors

ligen-ua avatar

Watchers

 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.