2009-05-28

Ruby log file management

I have been looking for a ruby log file management.  I looked at log4r but not sure it does what I want.  I am assuming a program that is run regularly to carry out a job. I would like the following:

1) for log files to be created for each run.  These to be stored in a log file directory

2) For the log files to be managed eg stored in log\2009\2009-04 and then a log file per day and a method of multiple log files per day.

3) The log files to have a format so that they are quite happy to crash in the middle, computer turned off and still be well formed and to have written everything that has been done out safely.  IE they can’t use regular XML format as can’t rely on closing brackets

4) Ideally have a graphical hierarchical tool to show you what happened.  Eg how long does something take over time, how often has it gone wrong.  A task would log start and end events. How many have happened per month etc  Looking at graphical environements this seems more suited to a rubyfx than shoes as rubyfx has support for a tree list.  Ideally the top levels of the tree would be the file directory structure.

5) The structure to cope with hierarchical logging eg

Start A
  Start B
  End B
  Start B
End A

Shows two B inside an A, on of the B’s was unsuccessful

6) Automatic log control eg ability to have only n Months of logs, to keep only say end of month logs after 1 year and even log thinnning where old logs are first thinned by getting rid of sub levels to take up less space.  Fixed space could also be used.

I think this is as far as I have got so far now back to some real work.

Later:  I have looked at YAML and think it is going to be helpful.

List of UK pottery suppliers

I have been trying to find a source of pottery supplies in the UK and wanted to list the main suppliers and some information about price.  I want to get some colour for the children to use, some clay, some slip for making bone china mugs in a mould and perhaps some plates.

I used ctm and they worked well.  Just need to get the kiln running now.

So in no particular order here they are:

Name Website Comments Price of colours Supplies clay,slip
http://www.ctmpotterssupplies.co.uk/ Complete supplier – good for larger quantities, based in Exeter. Delivery £10 per 25kg
Bit basic but functional web site
Scarva Erthenware glaze £5-£13 per kg powder, £6-£10 per 230ml/325g pot mixed.
Underglaze colour £2 to £4 per 100g pot. Pencils £3.20 each
porcelain 14.70 a gallon 8.64 for 12.5kg white earthenware
http://www.potterycrafts.co.uk/ Good website, Staffordshire
Duncan Covercoat
  Bone china and porcelain 5lt £21 £10 for 10KG for white earthenware
http://www.claymansupplies.co.uk/ Chichester    
http://www.dornhillpotterysupplies.co.uk/ Gloucestershire    
http://www.hobbyceramicraft.co.uk/ Focused on Ceramic cafe.    

2009-05-23

Playing with Ruby on rails on Windows

I have been playing with Rubymine which is a lovely development environment for Ruby.  I have a new web site development project so decided to learn Ruby on rails.

I have been reading Simply Rails 2 by Patrick Lenz and have now decided to actually try it out.  However the installation on Windows didn’t seem as straightforward as I thought it was going to be.  firstly the Instant rails seemed the wrong way to go as I already had ruby. So I did it by hand.

So I did gem install rails which worked fine.  Then downloaded rubymine and a 30 day free evaluation.  This then created my project for me.  So far so good.  I downloaded SQLite3 and put the .exe,.dll and .def in the Windows/ system32 directory, or rather I thought I did.   When I looked later Vista had prevented them.  So then I put them in c:\ruby\bin.

Had a bit of a problem with the SQL lite and I haven't been alone in this.  I created a data base with the SQL addin manager for Firefox.  Apart from using a .sqlite rather .sqlite3 that seemed ok. 

I had problems with installing the gem sqlite3-ruby and then I found this great post http://blog.emson.co.uk/2008/06/installing-sqlite3-on-windows-for-rails/

and it worked with gem install gem install sqlite3-ruby --version=1.2.3  and that seemed to work.

However ruby script/server still wouldn’t start up rails.  Time for supper.  The problem was I had corrupted the database.yaml file by adding a single character.  Once that was sorted it worked fine.