Home / Lua Scripts Libraries API Manual / dtutils.log / details
< dtutils.log
caller >

# details

## 🔗NAME

dtutils.log

## 🔗SYNOPSIS

darktable lua logging library

## 🔗USAGE

    local log = require "lib/dtutils.log"

## 🔗DESCRIPTION

log provides a multi-level logging solution for use with the darktable lua scripts. With this library you can leave log messages scattered through out your code and only turn them on as necessary.

## 🔗RETURN VALUE

log - library - the darktable lua logging functions

## 🔗FUNCTIONS

### 🔗 caller

get the name and line number of the calling routine

### 🔗 engine

get and set the output engine

### 🔗 log_level

get or set the log level

### 🔗 msg

print a log message

## 🔗EXAMPLE

    local log = require "lib/dtutils.log"
    local cur_level = log.log_level()
    log.log_level(log.warn)

print out warning, error and success messages as code is running

    log.log_level(debug)

print out debugging messages too because this isnt working

    log.log_level(info)

I want to make sure this is working ok

    log.log_level(cur_level)

reset the logging level back to normal

## 🔗LICENSE

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

< dtutils.log
caller >