mirror of
https://github.com/Insality/druid.git
synced 2025-09-27 18:12:19 +02:00
Update
This commit is contained in:
@@ -5,27 +5,6 @@ local druid_instance = require("druid.system.druid_instance")
|
||||
|
||||
local default_style = require("druid.styles.default.style")
|
||||
|
||||
--- Use empty function to save a bit of memory
|
||||
local EMPTY_FUNCTION = function(_, message, context) end
|
||||
|
||||
---@type druid.logger
|
||||
local empty_logger = {
|
||||
trace = EMPTY_FUNCTION,
|
||||
debug = EMPTY_FUNCTION,
|
||||
info = EMPTY_FUNCTION,
|
||||
warn = EMPTY_FUNCTION,
|
||||
error = EMPTY_FUNCTION,
|
||||
}
|
||||
|
||||
---@type druid.logger
|
||||
local logger = {
|
||||
trace = EMPTY_FUNCTION,
|
||||
debug = EMPTY_FUNCTION,
|
||||
info = EMPTY_FUNCTION,
|
||||
warn = EMPTY_FUNCTION,
|
||||
error = EMPTY_FUNCTION,
|
||||
}
|
||||
|
||||
|
||||
---Entry point for Druid UI Framework.
|
||||
---Create a new Druid instance and adjust the Druid settings here.
|
||||
@@ -45,13 +24,6 @@ function M.new(context, style)
|
||||
end
|
||||
|
||||
|
||||
---Set the logger for the Druid instance.
|
||||
---@param logger_instance druid.logger The logger
|
||||
function M:set_logger(logger_instance)
|
||||
self.logger = logger_instance or empty_logger
|
||||
end
|
||||
|
||||
|
||||
---Register a new external Druid component.
|
||||
---Register component just makes the druid:new_{name} function.
|
||||
---For example, if you register a component called "my_component", you can create it using druid:new_my_component(...).
|
||||
|
Reference in New Issue
Block a user