Giter Site home page Giter Site logo

Comments (9)

typicode avatar typicode commented on May 18, 2024

It's planned :)

from hotel.

kbariotis avatar kbariotis commented on May 18, 2024

@KevinSheedy the way I think about it, is that you can easily integrate any app to log output to logio and then just have hotel manage an instance of that app.

But to increase your request, I would say that If we could completely integrate, at least at first, the output of the command that hotel manages, that could mean that a lot of people could easily stop opening their terminals(including me) to start an app for development, just to have their debugging logs.

How are you thinking of implementing it @typicode. I would love to help.

from hotel.

typicode avatar typicode commented on May 18, 2024

Hi @kbariotis,

Thank you for the help :). I've hacked something a few weeks ago. It's quite simple to expose an API and use Server-Sent Events to get logs.

However for the UI, I don't know how to mimic the terminal scrollbar (when scrollbar is a the bottom it should always be at the bottom, and if the user moves it, it should stay where it is). It would be helpful if you can look for the code snippet that would allow that.

from hotel.

kbariotis avatar kbariotis commented on May 18, 2024

Hey @typicode, I've tried creating a prototype over Codepen but I couldn't make a nice replication scenario. :P

Anyway, here's the idea using jQuery. This is just the POC:

var scroll = false;
var $terminal = $('.terminal');

$terminal.on('scroll', function() {

  /* Determine whether we are at the bottom or anywhere above */
  if($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight) {
    scroll = true;
  } else {
    scroll = false;
  }
});

/* We are inserting logs into the terminal */

if(scroll) {
  /* If scrollbar was at the bottom, scroll it down since new text has been added */
  $terminal.scrollTop( $section.prop('scrollHeight'));      
}

from hotel.

kbariotis avatar kbariotis commented on May 18, 2024

BTW, @KevinSheedy, I have found https://github.com/kilianc/rtail which is a replacement for logio and instead of getting logs through direct calls, it inspects the output of the terminal through pipes. That means that you even use it with hotel even out of the box.

You would add a command like this node server.js 2>&1 | rtail --id "api.myproject.com" to hotel.

Ref. https://github.com/kilianc/rtail#examples

from hotel.

typicode avatar typicode commented on May 18, 2024

@kbariotis Thank you for the code snippet 👍

from hotel.

typicode avatar typicode commented on May 18, 2024

It has been released :) Simply click on the > icon and you should see logs.
Thank you again for the help and feedback.

from hotel.

fritx avatar fritx commented on May 18, 2024

When I switch among tabs, the output logs just disappeared and became blank.
What's going on? 😕

from hotel.

typicode avatar typicode commented on May 18, 2024

Logs are actually not kept in memory.
I plan to improve that in the next releases as it's a little bit annoying for me too 😅

from hotel.

Related Issues (20)

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.