Simple logger for debugging purposes
Note: "methods" in this module are actually "static" functions - see hs.logger.new()
Signature | hs.logger.defaultLogLevel |
---|---|
Type | Variable |
Description |
Default log level for new logger instances. |
Source | extensions/logger/logger.lua line 203 |
Signature | hs.logger.history() -> list of log entries |
---|---|
Type | Function |
Description |
Returns the global log history |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 94 |
Signature | hs.logger.historySize([size]) -> number |
---|---|
Type | Function |
Description |
Sets or gets the global log history size |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/logger/logger.lua line 69 |
Signature | hs.logger.new(id, loglevel) -> logger |
---|---|
Type | Function |
Description |
Creates a new logger instance |
Parameters |
|
Returns |
|
Notes |
Example: local log = hs.logger.new('mymodule','debug')
log.i('Initializing') -- will print "[mymodule] Initializing" to the console```
|
Source | extensions/logger/logger.lua line 211 |
Signature | hs.logger.printHistory([entries[, level[, filter[, caseSensitive]]]]) |
---|---|
Type | Function |
Description |
Prints the global log history to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 139 |
Signature | hs.logger.setGlobalLogLevel(lvl) |
---|---|
Type | Function |
Description |
Sets the log level for all logger instances (including objects' loggers) |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 30 |
Signature | hs.logger.setModulesLogLevel(lvl) |
---|---|
Type | Function |
Description |
Sets the log level for all currently loaded modules |
Parameters |
|
Returns |
|
Notes |
|
Source | extensions/logger/logger.lua line 46 |
Signature | hs.logger.level |
---|---|
Type | Field |
Description |
The log level of the logger instance, as a number between 0 and 5 |
Source | extensions/logger/logger.lua line 285 |
Signature | hs.logger.d(...) |
---|---|
Type | Method |
Description |
Logs debug info to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 352 |
Signature | hs.logger.df(fmt,...) |
---|---|
Type | Method |
Description |
Logs formatted debug info to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 362 |
Signature | hs.logger.e(...) |
---|---|
Type | Method |
Description |
Logs an error to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 289 |
Signature | hs.logger.ef(fmt,...) |
---|---|
Type | Method |
Description |
Logs a formatted error to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 299 |
Signature | hs.logger.f(fmt,...) |
---|---|
Type | Method |
Description |
Logs formatted info to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 341 |
Signature | hs.logger.getLogLevel() -> number |
---|---|
Type | Method |
Description |
Gets the log level of the logger instance |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 275 |
Signature | hs.logger.i(...) |
---|---|
Type | Method |
Description |
Logs info to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 331 |
Signature | hs.logger.setLogLevel(loglevel) |
---|---|
Type | Method |
Description |
Sets the log level of the logger instance |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 265 |
Signature | hs.logger.v(...) |
---|---|
Type | Method |
Description |
Logs verbose info to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 373 |
Signature | hs.logger.vf(fmt,...) |
---|---|
Type | Method |
Description |
Logs formatted verbose info to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 383 |
Signature | hs.logger.w(...) |
---|---|
Type | Method |
Description |
Logs a warning to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 310 |
Signature | hs.logger.wf(fmt,...) |
---|---|
Type | Method |
Description |
Logs a formatted warning to the console |
Parameters |
|
Returns |
|
Source | extensions/logger/logger.lua line 320 |
© 2014–2017 Hammerspoon contributors
Licensed under the MIT License.
https://www.hammerspoon.org/docs/hs.logger.html