-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dd6d216
commit 365c1de
Showing
4 changed files
with
53 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,11 @@ | ||
# Just use the production settings | ||
# Load production defaults | ||
require File.expand_path("../production.rb", __FILE__) | ||
|
||
# Overwrite production defaults | ||
# Staging settings | ||
Rails.application.configure do | ||
config.action_mailer.default_url_options = { | ||
host: ENV["AG_WEATHER_HOST"] || "dev.agweather.cals.wisc.edu", | ||
protocol: "https" | ||
} | ||
config.log_level = :debug | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# custom color-coded logging | ||
class DevLogger < Logger::Formatter | ||
PAL = { | ||
black: "\u001b[30m", | ||
red: "\u001b[31m", | ||
green: "\u001b[32m", | ||
yellow: "\u001b[33m", | ||
blue: "\u001b[34m", | ||
magenta: "\u001b[35m", | ||
cyan: "\u001b[36m", | ||
white: "\u001b[37m", | ||
reset: "\u001b[0m" | ||
} | ||
|
||
SEV = { | ||
debug: "DBG", | ||
info: "NFO", | ||
warn: "WRN", | ||
error: "ERR", | ||
fatal: "FTL", | ||
unknown: "UNK" | ||
} | ||
|
||
CLR = { | ||
debug: PAL[:green], | ||
info: PAL[:white], | ||
warn: PAL[:yellow], | ||
error: PAL[:red], | ||
fatal: PAL[:red] | ||
} | ||
|
||
def initialize(app_name = "dev") | ||
@app = app_name | ||
end | ||
|
||
def call(severity, time, progname, msg) | ||
sev = severity.to_sym.downcase | ||
msg = msg&.truncate(500, omission: "...") | ||
"#{CLR[sev]}[#{@app} #{SEV[sev]}] #{msg}#{PAL[:reset]}\n" | ||
end | ||
end |