Skip to content

Instantly share code, notes, and snippets.

@marzzz21
Created November 15, 2016 03:47
Show Gist options
  • Save marzzz21/67b4ad8f4871720f874123b54fb3f9f9 to your computer and use it in GitHub Desktop.
Save marzzz21/67b4ad8f4871720f874123b54fb3f9f9 to your computer and use it in GitHub Desktop.
1 module MirrorSyncUtilities::Logging
2
3 LOG_DIR = BASE_DIR + '/logs'
4 DAEMON_LOG = LOG_DIR + '/mirrorsync.log'
5
6 def log(msg)
7 puts "#{Time.now} > [#{Process.pid}] #{msg}"
8 end
9
10 def log_error(error)
11 log "#{error}\n\t#{error.backtrace.join("\n\t")}"
12 end
13 end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment