Displaying 20 results from an estimated 2000 matches similar to: "Access rails logger from plain class"
2007 Mar 30
2
Replacing slot of S4 class in method of S4 class?
Dear all,
Assume that I have an S4 class "MyClass" with a slot "myname", which
is initialized to: myname="" in method("initialize"):
myclass <- new("MyClass", myname="")
Assume that class "MyClass" has a method "mymethod":
"mymethod.MyClass" <-
function(object, myname=character(0), ...) {
2017 Sep 22
2
S4 method implementation for S3 class
Hi all,
I'm trying to implement the matrix multiplication operator, which is
S4 generic, for an old-style S3 class. The following works as
expected:
x <- 1:10
class(x) <- "myClass"
setOldClass("myClass")
setGeneric("myMethod", function(x, y) standardGeneric("myMethod"))
setMethod("myMethod", c("myClass", "myClass"),
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
2011 Jun 01
1
Overloading S4 methods
Dear all,
I am experiencing some problems with S4 method overloading. I have
defined a generic for graphics:plot, using
setGeneric("plot", useAsDefault = plot)
and with
importFrom('graphics', 'plot') and
exportMethods('plot') in the NAMESPACE file of pkg A.
I then proceed to define a method for signature c('myS4class',
'missing'). This works
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
2012 Aug 03
1
Interaction between callNextMethod() and selectMethod()
Hi,
Strange things happen. Here is a simple example:
> setClass("A", contains="integer")
> setMethod("as.matrix", "A", function(x, ...) t(callNextMethod()))
Creating a generic function for ?as.matrix? from package ?base? in
the global environment
[1] "as.matrix"
> a <- new("A", 1:3)
> as.matrix(a)
2002 Nov 05
1
function showMethods and inheritance
Hi,
The following question might come from my (deep) misunderstanding
of the concepts in the package 'methods'.
I have a class 'A', and a class 'B' inheriting 'A' (so defined
with 'setClass' and the parameter 'contains="A"'. The class
A has a method 'mymethod'. A call to 'showMethods("mymethod")'
return the
2005 Oct 27
1
Logger datetime_format not working ?
I''m trying to configure logger in a rails app.
I added this to my environment.rb :
RAILS_DEFAULT_LOGGER.datetime_format = "%Y-%m-%d %H.%M.%s"
Yet, none of the entries in the development.log show the datestamp.
What can you tell me about this ?
Thanks.
Peter Fitzgibbons
_______________________________________________
Rails mailing list
2016 Nov 24
3
llvm optimizer turning musttail into tail
I've got some calls like:
musttail call void bitcast (i32 (i32, i8*, %Type*)* @MyMethod to void
(i32, i8*)*)(i32 %0, i8* %1)
ret void
Into something like:
%8 = tail call i32 @MyMethod(i32 %0, i8* %1, %Type* null)
ret void
I realize I'm losing a parameter there, but this is an interface jump
trick I use and relies on the end code being a 'jmp' (x86). I realize i
can probably
2010 Dec 22
1
forcing evaluation of a char string argument
I'm trying to make a function to turn a regular function into an S3 generic
one. I want myMethod to be:
function(x,...) UseMethod("myMethod")
But I keep getting:
function(x,...) UseMethod(func)
Here's the function:
toGeneric<-function(func) {
env<-environment(get(func))
# default method of new generic = the original function
2007 Mar 16
1
sort_link_helper and cross-controller partials
Hello Rubyists,
I ran into a problem with sorting a table (rendered in a partial) using
the sort_link_helper methods after I have submitted data and re-rendered
the table through an AJAX request.
The setup is a follows:
The table is a shared partial of Controller1 and Controller2 accessible
via "shared/table". The AJAX''ed sorting using the sort helper works all
fine on
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
2006 Aug 10
1
Passing parameters defined in a function or something
Hi,
I have method I want to call ... it can receive * number of parameters.
I also have 3 parms that I want to pass often, so I have defined them in
a separate function:
def my_params
{ :parm1 => 1, :parm2 => 2, :parm3 => 3 }
end
And I want to call my method like this:
mymethod :parm4 => 4, my_params
Now - this doesn''t work - as my_params is a hash of params, which
2017 Sep 22
0
S4 method implementation for S3 class
The %*% function is a primitive. As it says in the documentation under
?Methods_Details
Methods may be defined for most primitives, and corresponding
metadata objects will be created to store them. Calls to the
primitive still go directly to the C code, which will sometimes
check for applicable methods. The definition of ?sometimes? is
that methods must have been detected
2016 Nov 27
3
llvm optimizer turning musttail into tail
r287955 seems like it might be related.
-- Sean Silva
On Sat, Nov 26, 2016 at 4:06 PM, Sean Silva <chisophugis at gmail.com> wrote:
> This sounds buggy to me. What pass is doing this?
>
> -- Sean Silva
>
> On Thu, Nov 24, 2016 at 5:39 AM, Carlo Kok via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>>
>> I've got some calls like:
>>
2006 Apr 04
2
Default logger inside arbitrary classes
Hi,
What''s the best way to get the default logger (the one used during the tests) from inside a class that doesn''t inherit any rails class?
Thanks
Oscar
---------------------------------
Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1¢/min.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
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'':
2006 Jan 12
3
How to Selectively Quite SQL Logging
I know about logger.silence but here is the issue: I''m comfortable with
the way the user engine is working, but it generates quite a bit of SQL
noise in the logs. I''d like, for that engine, to suppress the SQL
logging.
Code in it has return statements in conditionals, e.g.,
if !user?
RAILS_DEFAULT_LOGGER.debug "checking guest authorisation for
2006 Aug 06
2
Rails logger: how to access it in a my own class
Hey Guys,
The only way I could find to access the Rails logger object was to
subclass from ApplicationController... can anyone suggest a more
sensible way of doing it?
Soroe.
--
Posted via http://www.ruby-forum.com/.
2006 Feb 24
5
Plain text passwords displayed in production.log
By default, all the paramaters are displayed in the production.log on a POST.
Unfortunately, this includes all the plain-text passwords that people type
into the login form on my application, which is a huge security risk. I''m
using a custom evaluation system that hooks into LDAP (not any of the
generators/plugins).
View code is simple:
<%= text_field ''employee'',