It is currently May 2nd, 2024, 6:19 pm

Enigma - Help using Notes with log files

Get help with creating, editing & fixing problems with skins
bogitospeca
Posts: 11
Joined: December 7th, 2011, 1:39 pm

Enigma - Help using Notes with log files

Post by bogitospeca »

I'm trying to set the Notes for a desktop log of my apache access.log file. The problem is that the Note is displayed from the top, not scrolled to the bottom as I want it to be. I'll be glad if someone shares an idea, how this could be done :) Thanks in advance!

Last edited by jsmorley on October 16th, 2012, 1:52 pm, edited 1 time in total.
Reason: Edited to use [hsimg][/hsimg] for large images.
Alex Becherer

Re: Enigma - Help using Notes with log files

Post by Alex Becherer »

a way to do this is to use a Windows port of the UNIX tail command to write the last lines of the log file to a different file and display that file instead.
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Enigma - Help using Notes with log files

Post by Kaelri »

Open Enigma\@Resources\Measures\Notes.inc. Look for the "STRIP CONTENT DIVIDER & FORMAT LISTS" section, and change it to the following.

Code: Select all

	-- STRIP CONTENT DIVIDER & FORMAT LISTS
	local Divider = SELF:GetOption('ContentDivider','')
	Content       = Content:gsub(Divider..'.*', '')
	Content       = Content:gsub('- ', '· ')

	local Lines = {}
	for Line in Content:gmatch('[^\n]+') do
		table.insert(Lines, Line)
	end
	local LimitNumberOfLines = 20 --Change this to the number of lines from the bottom that you want to show.
	for i = 1, (#Lines - LimitNumberOfLines) do
		table.remove(Lines, 1)
	end
	Content = table.concat(Lines, '\n')

	Queue['Content'] = Content
Note that this will not handle line wrapping in any graceful way, so you should probably remove ClipString=1 from the meter style.
bogitospeca
Posts: 11
Joined: December 7th, 2011, 1:39 pm

Re: Enigma - Help using Notes with log files

Post by bogitospeca »

I seem not to have such Notes.inc file. Only Notes.lua in there :( Opened it and no such stuff in there, but still code.
EDIT: Rainmeter version: 2.3.2
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Enigma - Help using Notes with log files

Post by Kaelri »

bogitospeca wrote:I seem not to have such Notes.inc file. Only Notes.lua in there :( Opened it and no such stuff in there, but still code.
EDIT: Rainmeter version: 2.3.2
Sorry, Notes.lua is indeed the file that I meant.

The code that I described is found in the latest version of Enigma. I don't recall the specific changes to Notes.lua from 3 to 4; it should still be possible to apply the same process, but if you aren't comfortable editing Lua code, the safe option is simply to upgrade.
bogitospeca
Posts: 11
Joined: December 7th, 2011, 1:39 pm

Re: Enigma - Help using Notes with log files

Post by bogitospeca »

EDIT: my bad
User avatar
JoBu
Posts: 271
Joined: February 16th, 2011, 12:46 am
Location: California

Re: Enigma - Help using Notes with log files

Post by JoBu »

You might look into PSTools - I needed something similar for event logs on a remote machine. Installed PSTools, wrote a couple command line based scripts and I can filter, range and display whatever I need.