/solace-wip

Solace is a modern console replacement. Written in C++03

Primary LanguageC++

s◑lace

  • Solace is a modern console replacement. Written in C++03
  • Solace is HTML/Ajax based.
  • Solace is zlib/libpng licensed.

Features

  • Interactive REPL interface.
  • Built-in code editor.
  • Ajax queries.
  • Logging.
  • Stacktraces.
  • Filtering.
  • Tweakables.

Planned

  • Extending viewers for custom data.
  • Histograms (inputs). VNC outputs. Monkey testing. Maybe D3js.
  • Profilers. Maybe trace-viewer.
  • Code/Data visualization. Maybe D3js.
  • Save/Load Screenshots/thumbnails. Maybe any JQuery/lightbox gallery.
  • Save/Load Command history.
  • Framebuffer viewer. Maybe NativeWebSocketRender.
  • Stats.
  • Leaks.

Sample

~solace> cat sample.cc

#include <iostream>
#include <string>
#include <stdio.h>

#include "solace.hpp"

#ifdef _MSC_VER
#   define popen  _popen
#   define pclose _pclose
#endif

std::string evaluate( const std::string &cmd ) {
    std::string answer;
    FILE *f = popen( cmd.c_str(), "r" );
    if( f ) {
        char buff[2048];
        while( fgets(buff, 2048, f) ) answer += buff;
        pclose(f);
    }
    return answer;
}

int main() {
    // install solace html server
    solace::webinstall( 8080, &evaluate );

    // write to our log
    solace::cout << "Succesfully installed! " << 123 << std::endl;

    // capture std::cout and log it from here
    solace::capture( std::cout );
    std::cout << "Succesfully captured! " << 456 << std::endl;

    // do whatever
    for( std::string s; std::getline(std::cin, s); )
    {}

    // restore std::cout stream
    solace::release( std::cout );
}

~solace> ./a.out
Succesfully installed! 123
Succesfully captured! 456

build

cl *.cc *.cpp -I deps deps\route66\route66.cpp deps\heal\*.cpp /Zi /DNDEBUG /Oy-

possible output

image

licenses