Class: Log4r::EmailOutputter
- Defined in:
- lib/log4r/outputter/emailoutputter.rb
Instance Attribute Summary collapse
-
#acct ⇒ Object
readonly
Returns the value of attribute acct.
-
#authtype ⇒ Object
readonly
Returns the value of attribute authtype.
-
#domain ⇒ Object
readonly
Returns the value of attribute domain.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#tls ⇒ Object
readonly
Returns the value of attribute tls.
Attributes inherited from Outputter
Instance Method Summary collapse
-
#flush ⇒ Object
send out an email with the current buffer.
-
#initialize(_name, hash = {}) ⇒ EmailOutputter
constructor
A new instance of EmailOutputter.
Methods inherited from Outputter
[], []=, each, each_outputter, #only_at, stderr, stdout
Constructor Details
#initialize(_name, hash = {}) ⇒ EmailOutputter
Returns a new instance of EmailOutputter.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 12 def initialize(_name, hash={}) super(_name, hash) validate(hash) @buff = [] begin Logger.log_internal { "EmailOutputter '#{@name}' running SMTP client on #{@server}:#{@port}" } rescue Exception => e Logger.log_internal(-2) { "EmailOutputter '#{@name}' failed to start SMTP client!" } Logger.log_internal {e} self.level = OFF raise e end end |
Instance Attribute Details
#acct ⇒ Object (readonly)
Returns the value of attribute acct.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def acct @acct end |
#authtype ⇒ Object (readonly)
Returns the value of attribute authtype.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def authtype @authtype end |
#domain ⇒ Object (readonly)
Returns the value of attribute domain.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def domain @domain end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def port @port end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def server @server end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def subject @subject end |
#tls ⇒ Object (readonly)
Returns the value of attribute tls.
10 11 12 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 10 def tls @tls end |
Instance Method Details
#flush ⇒ Object
send out an email with the current buffer
31 32 33 34 |
# File 'lib/log4r/outputter/emailoutputter.rb', line 31 def flush synch { send_mail } Logger.log_internal {"Flushed EmailOutputter '#{@name}'"} end |