Skip to content

AutoHotkey-V2/log4ahk

Repository files navigation

log4ahk AutoHotkey2

This library uses AutoHotkey Version 2. (Tested with AHK v2.0-a100-52515e2 x64 Unicode)

Description

Simple logging with AutoHotkey - supporting some features as provided in log4j or log4Perl

Usage

Include log4ahk.ahk from the lib folder into your project using standard AutoHotkey-include methods.

#include <log4ahk.ahk>

; Initialize the logger
logger := new log4ahk()
; Set the appenders to be logged to: STDOUT
logger.appenders.push(new logger.appenderstdout())
; Set the layout for the messages
logger.layout.required := "[%V] #%M# %m"
; Choose the desired loglevel
logger.loglevel.required := logger.loglevel.INFO
logger.trace("TraceTest") ; This Message should not be logged due to choosen loglevel
logger.info("InfoTest") ; This Message should be logged!

For usage examples have a look at the files log4ahk_demoXX.ahk.

For more detailed documentation have a look into the source file log4ahk.ahk or online html-documentation