Coder Social home page Coder Social logo

rolandpheasant / tailblazer Goto Github PK

View Code? Open in Web Editor NEW
2.2K 128.0 248.0 73.49 MB

A modern file tail utility based on Rx.Net which show cases reactive programming and Dynamic Data (see https://github.com/RolandPheasant/DynamicData)

License: GNU General Public License v3.0

C# 100.00%

tailblazer's People

Contributors

abuzhynsky avatar alexanderfast avatar bachmeierm avatar butchersboy avatar edcourtenay avatar filipdevos avatar gitter-badger avatar ivanatpr avatar khellang avatar kstrauss avatar mgnslndh avatar mrcull avatar mreichardt95 avatar peter-b- avatar pmiossec avatar punker76 avatar rolandpheasant avatar schulz3000 avatar t0mburton avatar thezim avatar wmaurer avatar yiabiten avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tailblazer's Issues

Keyboard shortcuts

As the title suggests, keyboard shortcuts for such as searching through files.

Clipboard support

There definitely should be a possibility to copy a piece of log to the clipboard.

Take a closer look at Encoding

Currently using Encoding.Default and specifying the detectEncodingFromByteOrderMarks=true in the constructor of the stream reader when indexing a log file. The indexer determines the start position and length of each line including the delimiter. It also determines what the line delimiter is (different for Windows, Mac, Unix).

When the content of the line is read because it comes it view, the Encoding used by the reader is not necessarily the same as used by the stream reader as the code bypasses use stream reader all together. Also in the code it assumes a 2 character windows delimiter.

This need sorting out sooner rather than later!

For reference see:
LineIndexer.cs
FileInfoEx (see last overoad of ReadLines(...) method)

Change tab naming algorithm

When I open two files with the same name (for example, C:\MyProject\x86Debug\Logs\log.txt and C:\MyProject\x86DebugServer\Logs\log.txt), the tab bar looks like this:

image

It is not a very nice; it's hard to distinguish these files. Consider naming the tabs according to the file path fragments that are long enough to distinguish the tabs. For example, here's how Atom renders the tabs for the same two files:

image

Fast searching

At the time of raising this issue I am almost finished with re-factoring the code base to handle extremely large files. So far in my tests at work I have manage to load a 13Gb file in about 2 seconds and can scroll from bottom to top in a blink - and that is over a network share.

Never one to rest on his laurels it is time to consider the next task. On a file this large the search mechanism can chug away for several minutes without yielding any results so I propose a much better concept for searching

  1. Produce list of searchable segments (i.e. file partitions to enable search in chunks - DONE)
  2. Order them to search - head / tail segments first
  3. On segment search complete report back to consumer latest results, find next segment to search on.
  4. User should be able to cancel / resume any time
  5. Before and after each search display results and provide user with some progress feedback
  6. Always have an active search for the tail item [tail on a search]
  7. When all is done, maybe a way to limit the number of matched items
  8. Allow multiple searches and allow searches to be stored

Use this concept as a basis for a unified mechanism to

  1. Search on
  2. Find in file / navigate
  3. Alert to user when conditions are met
  4. Highlight lines match text

When all this is done I will put my feet up and smoke a big fat cigar - and you know what? I don't smoke!

Temporal indicator

Probably a bit early in this project's development to be making this suggestion, but it would be really cool if there were an option to turn on some kind of marker for empty periods of log activity.

For example, during development it's common to flip-flop between making coding changes and then testing them out. After a test, you dip into the log to see what's happened and you quite often have to fish around for the start of the test by looking for the gap in the timestamps.

The feature I imagine is that if a period of time passes (e.g. one minute) with no log updates then Tail Blazer would draw a horizontal rule, or an empty row with an icon and the elapsed time or somesuch to indicate that time has passed. This would make it really easy to see the clusters of activity in the log file.

Example:

2015-11-16 16:53:01 Blah blah
2015-11-16 16:53:01 Wah wah
2015-11-16 16:53:02 Nee nah
       ↕ ↕ ↕ 00:02:05 seconds ↕ ↕ ↕
2015-11-16 16:55:06 Whoop de doop
2015-11-16 16:53:01 La la la

Ideally the length of time at which such an indicator would be drawn would be configurable.

Conditionally highlight text

Allows user to conditionally highlight lines or text using plain text or regex.

Should allow user to enter any number of conditions and prioritise rules.

Plug-in to any provider of lines

There have been some very interesting requests for enabling Tail Blazer to be the visualisation of external data sources. So far there have been requests for:
#47 Tx Support
#44 Open pipe instead of file
#20 SSH/SFTP Support for Tailing Remote Files

Also but not raised, plug-ins for the following has been asked for:

  • Local instance of Elastic Search
  • Windows event viewer logs
  • TCP and UDP (Log4net, NLog, log4j enable this)

To account for these requests I have completed some major re-architecting and provided some very simple plug-in interfaces which if implemented can be used as a source of lines.

The plug in observable is:

    IObservable<ILineProvider>

And ILineProvider is:

    public interface ILineProvider
    {
        bool IsEmpty { get; }
        int Count { get; }
        IEnumerable<Line> ReadLines(ScrollRequest scroll);
    }

With a little tweaking of my code I will be able to drop IsEmpty and Count as these can be derived from the results.

If the connectivity to each of these can be driven from within Tail Blazer then I see no reason why I couldn't allow external plug-ins for any of these providers + more

Has anyone got any more ideas, or would anyone like to help?

Highlight new lines

When a file is being tailed any new lines added to a file should be highlighted for a short period of time

Inline view scroll position randomly reset

When showing search results with the inline view enabled I have noticed that if you scroll in the inline view after a short delay (a couple of seconds) the inline view will scroll back to it's original position.

Word wrap

I'd like to see an option for automatic word wrap on lines, which are not representable on the monitor without scrolling horizontally.

Not rolling over correctly

Due a major re-write of the heart of the system #42, a knock on effect has been that files are not being correctly followed after roll-over of log files.

Both FileSearch.cs and SparseIndexer.cs need to account for a file becoming smaller. In this case the file should be treated as a new file and all cache data should be cleared down.

Crashes when I open a log

I've tried to open a variety of log files of various sizes using drag-drop and the menu option but Tail Blazer crashes every time.

Here's the entry from the event viewer:

Fault bucket , type 0
Event Name: CLR20r3
Response: Not available
Cab Id: 0

Problem signature:
P1: TailBlazer.exe
P2: 0.2.1.91
P3 :565377bc
P4: PresentationFramework
P5: 4.5.27.0
P6: 545cb089
P7: 2b7d
P8: 215
P9: System.Windows.Markup.XamlParse
P10: 

Attached files:
C:\Users\ME\AppData\Local\Temp\WER9C05.tmp.WERInternalMetadata.xml

These files may be available here:
C:\Users\ME\AppData\Local\Microsoft\Windows\WER\ReportArchive\AppCrash_TailBlazer.exe_7242bbd390b4a3e70eeb19c5a816bd8c2b82651_ba3fa94e

Analysis symbol: 
Rechecking for solution: 0
Report Id: cca1fc0e-9299-11e5-92cb-7446a0a3e8d8
Report Status: 1

Use monospaced font

The logs look a bit weird with a proportional font. I imagine most people (with a few exceptions) would expect to see a monospaced font in use.

Need Icon

I am no designer so would be very happy if someone could design an icon for tail blazer.

Ideally the icon would be provided in .ico format as well as the xaml path.

Find in file

Currently when a user enters text to search the result returns filtered lines.

From these results it would be good to enable find lines in file. This would require find first, next, previous and last functionality.

Fine tune performance

  1. Scrolling can be sluggish on files which have a very large number of lines. So far I have seen scrolling stutter on a file with 800k lines which was opened on a server share. In theory this can be solved by adjusting the scrolling sample rate, but in practice it is hard to predict when back pressures are formed. The idea solution would be for a task to run and if a queue has formed disregard all but the end of the queued job.
  2. Some times there is a minor latency when opening a file.
  3. Investigate whether the read algorithms can be improved

Line hightlighting

First of all, great job so far.

Probably it's already a feature at your to-do list. But is it possible to have the possibility to highlight lines matching a certain string. For example to be able to highlight lines starting with [E].

Edit: My bad, hadn't seen it at the future features list.

Problem with very long lines in the file

When a file is opened with very long line widths, the searchable text box attempts to wrap the text to a new line when it should not. It leaves approximately 1.3 lines showing where there should be 1 line.

Not only does it look ugly but it has an adverse effect on scrolling

@tomekka I am looking into this.

Log not rendering

I encountered a bug where the TextBlock (?) doesn't want to render unless it overflows and a scrollbar appears (screenshots 0 and 1).

When starting from a log file which doesn't contain entries, I even had to reopen the file (screenshot 2).

tailblazer-not-rendering-log-bug-0
tailblazer-not-rendering-log-bug-1
tailblazer-not-rendering-log-bug-2

Note: This is from the build of the release page. Not a build I made myself.

Open pipe instead of file

It would be very nice to pipe command output to TailBlazer and use it as a log viewer (as a real tail program). For example,

cmd> nginx | TailBlazer

(nginx here is just an example of a long running application)

It would be even more nicer to connect to any running process stdout and read its logs, but I fear that it will involve much native code magic and dealing with Windows permissions; maybe it isn't possible at all.

chocolatey

Pleeeeeeeeeeease publish this to chocolatey :D
Thanks!

Find in file

Currently when a user enters text to search the result returns filtered lines.

From these results it would be good to enable find lines in file. This would require find first, next, previous and last functionality.

Tx Support

It would be nice if TailBlazer supports accessing logging from Event Tracing for Windows which is the preferred logging mechanism when performance is critical.
The TX library (https://github.com/MSOpenTech/Tx) should be a great starting point as it offers a Rx based access to the ETW data.

Missing LICENSE or COPYING

Hopefully the license is GNU GPL v3, in any case it would be nice to see which license this code is under.

Tail file even after it has been newly created

Both nlog and log4net have the concept of rolling log files, where based on a certain condition (file size, time of day), the log file is archived, and a new 'current' log file is created.
I assume in this case the 'current' log file is renamed, and a new 'current' file is created, with the same name, e.g.

Web.Server.SignalR.201511180800.log
Web.Server.SignalR.201511180830.log
Web.Server.SignalR.log <-- current

However when I tail the 'current' log file, TailBlazer stops tracking changes after the rollover has occurred.

Another non-modern application (baretail) does this correctly. It would be great if TailBlazer could also do this.

SSH/SFTP Support for Tailing Remote Files

Not sure how feasible this is but it would be really neat to have the ability to tail files on a remote server via SSH and/or SFTP. Most log files that I'm interested in tailing live in remote unix servers.

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.