view src/luan/modules/logging/Logging.luan @ 1353:8d95711f6615

replace java() with require "java"
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 20 Mar 2019 17:03:29 -0600
parents 11b7e11f9ed5
children 219f2b937f2b
line wrap: on
line source

require "java"
local LuanLogger = require "java:luan.modules.logging.LuanLogger"

local Package = require "luan:Package.luan"
if Package.load("java:org.apache.log4j.Logger") ~= false then
	require "luan:logging/Log4j.luan"
end


local Logging = {}

function Logging.logger(name)
	local luan_logger = LuanLogger.new(name)
	return {
		error = luan_logger.error
		warn = luan_logger.warn
		info = luan_logger.info
		debug = luan_logger.debug
	}
end

return Logging