Jump to content

Question about the logs panel tree color


bernhard
 Share

Recommended Posts

Hey @adrian I'm working on a new version of RockMigrations that triggers migrations automatically whenever a file changed. I'm using logs to echo some information about the migrations. Thats nice because when I change a file and reload the page I see that the migrations have run which is indicated by new logs which makes the tree icon orange.

What I noticed today is that sometimes this tree stays orange for additional 1-2 reloads... First I thought I might have some bugs in my change detection but the timestamps of the logs say there's been no change (no new log) but the icon indicates something different.

Does that make sense? How does the tree icon detect if it should be gray or orang?

Thx!

  • Like 1
Link to comment
Share on other sites

It's a bit hacky - it looks for an entry within the last 5 seconds and color orange if there is one. I figured this was probably OK for manual reloads. It turns the icon red if the last entry (within those 5 seconds) is an error.

I'll take a look at improving this - should be quite easy now that I am caching the results in a wirCache because I'll be able to tell if there is a new entry or not. This wasn't really possible until I introduced the caching. 

Link to comment
Share on other sites

Ok, please give the latest version a go. It should be much better in that you now get notification of new entries no matter when they happen relative to when you reload the page - they might even happen in another process. 

Thanks for prompting me to revisit this.

  • Like 1
Link to comment
Share on other sites

hi @adrian thx for the quick update!

Seems to work great now after some reloads!

Initially I had little problems, but the seem to be gone now, I'll share them FYI:

- updated tracy
- changed file (to trigger migrations)
- tree was red, not orange (why?)

I thought maybe there's something left somewhere...

- delete all logs
- change file (to trigger migrations)
- tree is gray, but new logs sow up

Ok one more...

- changed file (to trigger migrations)
- tree is orange, logs show up

Now everything works nicely!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...