«
Provides a bridge to OpenHAB Logging
# Log at a level
logger.<level>('Test logging at <level>')
level | |
---|---|
trace | |
debug | |
warn | |
info | |
error |
# Log at a level
logger.info "log <level>? #{logger.<level>?}"
level | |
---|---|
trace | |
debug | |
warn | |
info | |
error |
# Log at a level
logger.error { "Error Message in Block" }
# Log at a level
logger.info("Hello World!")
rule 'log test' do
on_start
run { logger.info('Log Test') }
end
def log_foo
logger.info('Foo')
end
rule 'log test' do
on_start
run { log_foo }
end
rule 'log test' do
on_start
run do
after 1.second do
logger.info('Bar')
end
end
end
type | name | state |
---|---|---|
Number | Foo | 0 |
rule 'log test' do
changed Foo, to: 5, for: 3.seconds
run do
logger.info('Baz')
end
end
gemfile do
source 'https://rubygems.org'
gem 'httparty'
end
logger.info("OpenHAB Rules!")