Permalink
Browse files

Clean up.

  • Loading branch information...
nahi
nahi committed Sep 18, 2003
1 parent 2ad8d39 commit 24bcea95cc3751e5acdf37e8a0eb0019aebda395
Showing with 4 additions and 33 deletions.
  1. +2 −3 sample/app.rb
  2. +0 −1 sample/log.rb
  3. +0 −26 sample/logToFile.rb
  4. 0 sample/logs/.keep_me
  5. +2 −3 sample/{logShifting.rb → shifting.rb}
View
@@ -1,14 +1,13 @@
#!/usr/bin/env ruby
-$:.unshift(File.join('..', 'lib'))
require 'logger'
class MyApp < Logger::Application
def initialize(a, b, c)
super('MyApp')
# Set logDevice here.
- logfile = File.join('logs', 'app.log')
+ logfile = 'app.log'
self.log = logfile
self.level = INFO
@@ -43,5 +42,5 @@ def foo(var)
if status != 0
puts 'Some error(s) occured.'
- puts 'See "app.log" in "logs" directory.'
+ puts 'See "app.log".'
end
View
@@ -1,6 +1,5 @@
#!/usr/bin/env ruby
-$:.unshift(File.join('..', 'lib'))
require 'logger'
log = Logger.new(STDERR)
View
@@ -1,26 +0,0 @@
-#!/usr/bin/env ruby
-
-$:.unshift(File.join('..', 'lib'))
-require 'logger'
-
-logfile = File.join('logs', 'logToFile.log')
-log = Logger.new(logfile)
-
-def do_log(log)
- log.debug('do_log1') { "debug" }
- log.info('do_log2') { "info" }
- log.warn('do_log3') { "warn" }
- log.error('do_log4') { "error" }
- log.fatal('do_log5') { "fatal" }
- log.unknown('do_log6') { "unknown" }
-end
-
-log.level = Logger::DEBUG # Default.
-do_log(log)
-
-puts "Set severity threshold 'WARN'."
-
-log.level = Logger::WARN
-do_log(log)
-
-puts 'See logfile in "logs" directory.'
View
No changes.
@@ -1,9 +1,8 @@
#!/usr/bin/env ruby
-$:.unshift(File.join('..', 'lib'))
require 'logger'
-logfile = File.join('logs', 'logShifting.log')
+logfile = 'shifting.log'
# Max 3 age ... logShifting.log, logShifting.log.0, and logShifting.log.1
shift_age = 3
# Shift log file about for each 1024 bytes.
@@ -24,4 +23,4 @@ def do_log(log)
do_log(log)
end
-puts 'See logShifting.* in "logs" directory.'
+puts 'See shifting.log and shifting.log.[01].'

0 comments on commit 24bcea9

Please sign in to comment.