search for: format_message

Displaying 15 results from an estimated 15 matches for "format_message".

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
2006 Nov 22
4
Error when starting bgrdb
Hi, I get this error when starting bgdrb using "rake backgroundrb:start" (on a Mac using bgdrb 0.2.0): /Users/gl/Projects/xxxxx/xxxxx/vendor/plugins/backgroundrb/server/lib/ backgroundrb_server.rb:33:in `format_message'': undefined method `strftime'' for "2006-11-22T12:34:18.524572 ":String (NoMethodError) from /usr/lib/ruby/1.8/logger.rb:320:in `add'' from /usr/lib/ruby/1.8/logger.rb:372:in `info'' from /Users/gl/Projects/xxxxx/xxxxx/vendor/p...
2006 May 03
6
ActiveRecord and Lost Connection
...ER BY created_on desc Here is kind of a unit-test # # Berlin Brown # Used to test active record connection # Run with: # # ruby connect_db.rb # require ''active_record'' require ''logger''; # Use the following to reformat the logging message: # class Logger; def format_message(severity, timestamp, msg, progname) "#{msg}\n" end; end ActiveRecord::Base.logger = Logger.new(STDOUT) ActiveRecord::Base.establish_connection( :adapter => "mysql", :host => "localhost", :username => "USER_NAME", :password => "P...
2006 Dec 04
1
no method error when starting backgroundrb
I just installed backgroundrb on our server. When tryin to start via script/backgroundrb i get a no method error. ./script/backgroundrb start /home/tom/ralf_dev/vendor/plugins/backgroundrb/server/lib/backgroundrb_server.rb:34:in `format_message'': undefined method `strftime'' for "2006-12-04T15:53: 23.419225 ":String (NoMethodError) from /usr/lib/ruby/1.8/logger.rb:320:in `add'' from /usr/lib/ruby/1.8/logger.rb:372:in `info'' from /home/tom/ralf_dev/vendor/plugins/backgroun...
2006 Jun 29
1
Logging in Rails
Is there any reason why active_record is overriding the method format_message of the class logger? -- Posted via http://www.ruby-forum.com/.
2006 Nov 10
0
Override logger for large binary data
...;tail -f log/development.log'' in a shell within emacs and it really doesn''t like the huge lines dumped out during saves/updates. So, I finally figured out that if I put the following in my config/environment.rb I can trim the binary data dumps: class Logger private alias old_format_message format_message def format_message(severity, timestamp, progname, msg) # uses a non-greedy match msg.to_str.gsub!(/= x''(.*?)''(,|\s)/,''= x\''BINARY_DATA\''\2'') "#{msg}\n" end end But, I know that this is a kluge so any ad...
2006 Mar 30
1
Logger::Format not defined (NameError) [NOOB]
I have just installed apache2 / php4 / mysql and RoR on a clean and minimal Ubuntu (5.10) server. I have set up a test site and can reach the "Welcome on board" index page. However when I run "ruby script/generate contoller firsttest" I get the following error. ./script/../config/../vendor/activesupport/lib/active_support/clean_logger.rb:13:in `remove_const'':
2008 Feb 19
0
Rails logger change format
Hi guys, After few investigations I still cannot change the format of logs from rails 2.0.2 apps. I tried with overwriting the format_message method from Logger class and still nothing. I know that in Rails 2.0.2 BufferedLogger is used and I didn''t manage to change the format for this one. What seems to be the easiest way to do that ? Thanks in advance. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------...
2009 Jul 07
1
[PATCH] Set up ovirt-agent so it starts as a daemon
...tic diff --git a/src/ovirt-agent/ovirt-agent.rb b/src/ovirt-agent/ovirt-agent.rb index ae55e3f..62834b0 100755 --- a/src/ovirt-agent/ovirt-agent.rb +++ b/src/ovirt-agent/ovirt-agent.rb @@ -23,6 +23,12 @@ require 'ovirt/controllers/task_controller' include Daemonize +class Logger + def format_message(severity, timestamp, progname, msg) + "#{severity} #{timestamp} (#{$$}) #{msg}\n" + end +end + # Monkey patch class Qmf::SchemaObjectClass attr_reader :id @@ -80,16 +86,47 @@ class OvirtAgent < Qmf::AgentHandler include Ovirt::SchemaParser - def initialize(host) + $lo...
2007 Nov 20
9
Timestamping in log file?
Hi, I''m wondering if it''s easy to add timestamps to the mongrel log? I am having a problem where an externally spawned application by Rails is failing. Mongrel kindly logs the error message returned by this application when it fails. But it doesn''t record a timestamp as to when the error occurs, which makes it a little tricky to sync this up to my webserver logs to
2005 May 22
1
ActiveRecord: can not connect to mysql
...r/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/core_ext/string/../../inflector.rb:76: warning: method redefined; discarding old singular_rules /usr/local/lib/ruby/gems/1.8/gems/activesupport-1.0.4/lib/active_support/clean_logger.rb:7: warning: method redefined; discarding old format_message /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/validations.rb:277: warning: `*'' interpreted as argument prefix /usr/local/lib/ruby/gems/1.8/gems/activerecord-1.10.1/lib/active_record/validations.rb:305: warning: `*'' interpreted as argument prefix /usr/loca...
2009 May 19
2
[PATCH server] added ovirt vnc proxy server, to proxy vnc request to managed vms
...'daemons' +include Daemonize + +########### + +DEFAULT_VNC_PROXY_PORT = 5900 +VM_NAME_MAX_LEN = 250 +VNC_DATA_MAX_LEN = 800000 + +########### + +# clone of the taskomatic / dbomatic logger; +# TODO move all of these seperate implementations into a single dutils module +class Logger + def format_message(severity, timestamp, progname, msg) + "#{severity} #{timestamp} (#{$$}) #{msg}\n" + end +end + +$logfile = '/var/log/ovirt-server/vnc-proxy.log' + +########### + + +class VncProxy + + # initialize vnc proxy + def initialize() + super() + do_daemon = true +...
2010 May 07
0
Wine release 1.1.44
...in FormatMessageW into a new function. kernel32: Separate format string parsing in FormatMessageA into a new function. kernel32: Transition FormatMessageA to the internal use of Unicode strings. kernel32: Unify the format_insert ANSI and Unicode helpers. kernel32: Unify the format_message ANSI and Unicode helpers. kernel32: Rename the load_message helper to reflect its sole handling of Unicode strings. kernel32: Fail if a format placeholder is present without a format specifier in FormatMessageA/W. kernel32: Remove leftover preprocessor undef directives in the Form...
2012 Sep 28
0
Wine release 1.5.14
...merateEx. kernel32: Report FILE_PERSISTENT_ACLS flag for NTFS volumes. shell32: Create the All Users Microsoft directory. Francois Gouget (35): msvcp71: Remove an unused debug channel. kernel32/tests: Add more FormatMessage() line wrapping tests. kernel32: Replace the format_message() helper macro with a static function. kernel32: There is no need to zero-fill the FormatMessage() temporary buffer. wined3d: Remove an unwanted trailing '\n' in shader_dump_register(). jscript: Make jsval_variant() static. d3dcompiler_43: Make add_type_to_scope() st...
2007 Sep 18
10
Routes
hi all, I want to move some routing tasks out of the router and into the controller. The goal is to make Merb feel less like mod_rewrite and give the user more control at the controller. The new Router is simple: it takes the path_info (not the whole request) then outputs a controller class and some parameters from the path matching. The rest of the routing would be done at the controller level.