New will return a new Helper in the event an error does not occur. This will parse the logLevel provided to figure out what logging is enabled. New will also validate that the log level is a valid value along with any mutually exclusive values.
(logLevels ...string)
| 114 | // also validate that the log level is a valid value along with any mutually |
| 115 | // exclusive values. |
| 116 | func New(logLevels ...string) (*Helper, error) { |
| 117 | h := &Helper{ |
| 118 | logLevels: logLevels, |
| 119 | } |
| 120 | |
| 121 | if err := h.setLogLevels(logLevels); err != nil { |
| 122 | return nil, err |
| 123 | } |
| 124 | |
| 125 | return h, nil |
| 126 | } |
| 127 | |
| 128 | // GetFirecrackerLogLevel will return the current log level for Firecracker. |
| 129 | func (h *Helper) GetFirecrackerLogLevel() string { |