From: Szymon Drejewicz Date: 2004-02-20T20:20:57+09:00 Subject: Re: how to raise warning? > module Kernel > alias :oldwarn :warn > def warn(msg="", fulltrace=nil) > trace = caller(1) > where = trace[0].sub(/:in.*/,'') > $stderr.puts "#{where}: Warning: #{msg}" > $stderr.puts trace.map {|t| "\tfrom #{t}"} if fulltrace > end > end Yes, this is exactly what I need :-) thank you Now it is possible to use just warn "Message body" and ruby adds line number by itself without using redundant syntax like warn "#{__FILE__}:#{__LINE__}: Message body." :-) -- Szymon Drejewicz