CKLog is a simple logging class with 5 debug levels, It writes log messages higher than setted level. The debug level is gDEBUG < INFO < WARN < ERROR < FATALh.
Method | Description |
---|---|
debug(message) |
Write message on DEBUG level. |
info(message) |
Write message on INFO level. |
warn(message) |
Write message on WARN level. |
error(message) |
Write message on ERROR level. |
fatal(message) |
Write message on FATAL level. |
Logging options are the following. Use log_options
attribute of CKApplication to initialize CKLog objects instead of setting each options to do directly.
Option | Description |
---|---|
level |
Debug level. |
name |
Program name. |
out |
Output. By default is standard error. |
file |
File name to output logs. Set this or out option. |
max_file_size |
Max file size (this enables if you set file to output). If size of the file is over this size, FileSizeError is raised. |
options = {elevelf => CKLog::DEBUG, enamef => eCGIKit Applicationf, efilef => elog.txtf, emax_file_sizef => 1000000} app = CKApplication.new app.log_options = options app.run
class MainPage < CKComponent def logging log = CKLog.new(application.log_options) log.debug elog messagef end end