Displaying 20 results from an estimated 20000 matches similar to: "Testable Logger"
2006 Jul 05
0
TestableLogger plugin
hello all,
i''ve created a plug-in from some test helper code i''ve been using.
hopefully some of you will find it useful.
in a nutshell, it lets you assert that messages were (or were not)
written to the application''s log file during a test case.
from the README:
Testable Logger acts as a buffered proxy in front of the normal
Logger object when running in a test
2006 Nov 16
0
Rails logger doesn't log nil, Ruby logger does
Is there some reason that the Rails logger doesn''t log nil as the string
"nil", like the Ruby logger does? It is a bit confusing.
Ruby example:
$ cat log.rb
require ''logger''
logger = Logger.new(STDOUT)
logger.info "test"
logger.info true
logger.info nil
logger.info "end test"
$ ruby log.rb
I, [2006-11-15T16:45:00.348262 #2058] INFO
2006 Jun 22
0
frugalist: rails tames amazon wishlists
hello rails folks,
i recently launched my first rails based web app at:
http://fr.ugali.st/
frugalist is a free service that pulls products from your wishlist(s)
at amazon.com and lets you create customizable rss feeds that filter
the products on those wishlists based on the criteria you define.
for example, i can add all 5 of my amazon wishlists and set up a feed
that will show me all
2008 Jun 12
1
how do I mock the Rails Logger with should_receive?
Hey Guys,
I''m trying to mock the Rails Logger for the following code:
...
rescue TimeoutError => error
$logger.error("#{self.name} Timeout for #{path}: #{error}") and return
rescue SocketError => error
$logger.error("#{self.name} SocketError for #{path}: #{error}") and
return
rescue StandardError => error
2008 Jun 12
1
Does anyone know how to mock the Rails Logger then set expectations with should_receive?
Hey Guys,
I''m trying to mock the Rails Logger for the following code:
...
rescue TimeoutError => error
$logger.error("#{self.name} Timeout for #{path}: #{error}") and return
rescue SocketError => error
$logger.error("#{self.name} SocketError for #{path}: #{error}") and
return
rescue StandardError => error
2005 Dec 16
2
Using logger from rails cron jobs
Hi. I''m trying to use logger from a rails cron job.
It works fine, but I''d like the standard ruby behavior of stamping each
log with date and time. How do I do this?
I''m trying:
# Set up out logging
require ''logger''
logger = Logger.new(STDERR)
logger.level = Logger::INFO
RAILS_DEFAULT_LOGGER = logger # Tell rails to log to our logger also
The
2005 Dec 14
0
Fwd: Logger bug in 0.14.3 ?
Hello All,
I am top-posting this in hopes of increasing the visibility.
This ticket has not been touched : Default Logger instance has no formatting
<http://dev.rubyonrails.org/ticket/3144>
For my installation, this is a BIG problem in my production logging !!
For now the workaround below is working, and the double-declaration warnings
of loading ''logger.rb'' twice are
2006 Jan 11
1
logger in my classes
Hi,
I wrote a class which is not an AR extension, nor a controller.
I''d like to use logger.* methods there too.
My class is in lib/ dir. I include it in environment.rb with the line
require ''lib/localization''
just after the line
require File.join(File.dirname(__FILE__), ''boot'')
I tried many ways to reuse the logger class. The cleaner way seemed to
2007 May 21
2
logger anybody?
Hello,
When trying to use logger into any RSpec I get:
logger anyboundefined local variable or method `logger'' for
#<#<Class:0x278bee0>:0x253cdec>
Not sure if this is the spected behaviour (haven''t checked under the
hood) It was just annoying not having a logger instance available as in
Rails out of the tests.
--
An?bal Rojas
http://www.rubycorner.com
2006 May 17
1
ActiveRecord vs logger
Appendix B.1 of the Agile book says you can configure as follows:
B.1 Active Record Configuration
ActiveRecord::Base.logger =logger
Accepts a logger object. This is used internally to record database
activity. It is also available to applications that want to log activity.
Yet, as far as I know, there is no way to use logger.info and friends within a model. Is
there? Or is this simply
2005 Sep 20
1
Javascript Logger and Console
Hey,
I put together a javascript logger and console that has made my coding
life a breeze, so I thought I would share it with you guys.
Check out the demo http://gleepglop.com/javascripts/logger/
Some features are...
- Toggle button so it is visiable when you need it and out of the way
when you don''t.
- Auto-positions itself at the bottom of the window so output is easy to read.
-
2010 Apr 15
1
Using Rails.Logger in a gem in Rails 3beta3
Hi fellows!
I want to use the Rails.logger in my gem. I try the following code in
my main gem-file.
require ''rails/logger''
puts "init1"
::Rails.logger.info("hi")
puts "init2"
The funny thing is: It even don''t give me the output of puts in the
stdout of the server!
But if I remove the call to Rails.logger the puts are displayed in the
2006 Jun 07
0
Logger in ActionWebService::Base?
I''d like to split up my directly dispatched controller into a layered
dispatch setup with one controller and two services derived from
ActionWebService::Base. However, in doing this I found that logger is
not a class_variable of AWS::Base. This kind of scares me away from
using the layered dispatch mode, as I''d like to have logging in the
method implementations. Is there a clean
2006 Jun 20
0
Quiet the Logger in 1.1
I''m using Rails 1.1 and I''m trying to quiet the logger. I searched the mailing list and placed the following inside my environment.rb:
RAILS_DEFAULT_LOGGER.level = (RAILS_ENV == ''production'' ? Logger::INFO : Logger::DEBUG)
But I keep getting:
/usr/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:123:in `const_missing'':
2005 Dec 29
2
Access rails logger from plain class
How can I "get" the rails logger from a plain class, that is a class
that does not inherit from a rails class?
I have tried using RAILS_DEFAULT_LOGGER (see below) but it''s nil
class MyClass
logger = RAILS_DEFAULT_LOGGER
def myMethod
logger.debug("stuff...")
end
end
--
Posted via http://www.ruby-forum.com/.
2012 Aug 01
0
Testable after_commit hooks for rails 4?
https://groups.google.com/d/topic/rubyonrails-core/i2k7dn-jRVg/discussion
What do you think about bringing the possibility to test after_commit hooks
while also using transactional fixtures to rails 4? Would the approach used
here https://gist.github.com/1169763 be acceptable?
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
2006 May 22
0
logger and ActionWebService - how can I get them to work together?
I''m adding a web service to a small Rails app that I wrote to learn
the framework. This is my last piece of the puzzle and I''m having
trouble figuring out how to debug it.
I was attempting to iteratively develop the web service method using
TDD. There''s so much coercion and stuff going on via the
ActionWebService framework that I''m looking to fall-back
2005 Dec 09
0
Default Logger -> Database log
Hi listers,
I''m trying to save my log entries in the database using the following technique :
http://wiki.rubyonrails.com/rails/pages/DatabaseLoggerWish
I''ve added the following code to the Environment.rb :
----------------------------------------------------------------------------
begin
RAILS_DEFAULT_LOGGER = DBErrorLogger.new()
rescue StandardError
2014 Oct 23
1
logger.conf
with the below defined in logger.conf on 11.6 cert 6
I am not getting any log message other than notice and warning in any files
when doing module reload logger - queue log is the only one that says it
restarts
*CLI> module reload logger
== Parsing '/etc/asterisk/logger.conf': Found
Asterisk Queue Logger restarted
built fresh box with make samples - added 2 stations, dialing from
2010 Jun 07
2
Trying to get N1MM Logger working under Wine
I am trying to use an amateur radio logging program under Wine, but other than installation, I've been unable to get the program running. Most likely I just need some assistance figuring out which DLLs are still missing. On advice I installed DCOM98 and VCRUN6 and set mfc42, ole32 and rpcrt4 to (builtin, native).
So far all I get are a few dialog boxes, the first titled "EntryWindow