From: Ronald Fischer Date: 2007-07-17T20:56:43+09:00 Subject: log4r configuration: "/dev/null" outputter question Well, my code does seem to work, but I have the feeling that I could have done it much simpler.... So here is my problem: I would like to control log4r via an environment variable, which can contain one of 4 types of values: stdout : logging goes to stdout stderr : logging goes to stderr file:FILENAME : logging goes to FILENAME none : logging not needed The problem is what outputter to use to implement 'none'. My first idea to simply use FileOutputter('none',:filename => '/dev/null') does not work because my code is also supposed to run onder Windows where we don't have /dev/null. So I came up with the solution to invent a "NullOutputter": class NullOutputter $1, :trunc => true when 'none' NullOutputter.new 'tfwnull' end Note that I did NOT use when 'none' Outputter.new 'tfwnull' because Outputter is documented as abstract class. My solution works, but I wonder whether I could make it simpler (i.e. without creating the NullOutputter class). Ronald -- Ronald Fischer Phone: +49-89-452133-162