Code Monkey home page Code Monkey logo

remotelog-lua's Introduction

remotelog - Remote logging for Lua

Overview

The remotelog is a Lua module that provides logging capabilities. While it supports regular logging to STDOUT too, it is mainly targeted at systems where a log receiver must be on a different machine, especially when debugging problems in server processes.

The module is designed to be easily usable, compact and fast. It was originally created to allow remote logging from Lua scripts running inside an Exasol database, but works in other context as well.

In a Nutshell

The following snippet demonstrates basic remote logging. Check the user guide for more details.

local log = require("remotelog")
log.connect("thehost.example.org", 3000)
log.info("Hello world.")
log.disconnect()

Features

  • Logging to STDOUT
  • Logging to remote log receiver via a TCP socket
  • Configurable automatic fallback in case socket connection cannot be established
  • Log level control
  • Configurable timestamp format
  • Optional high-resolution timer

Table of Contents

Information for Users

Information for Developers

Run Time Dependencies

remotelog requires Lua 5.1 or later.

Dependency Purpose License
LuaSocket Socket communication MIT License

Note that LuaSucket is pre-installed on an Exasol database. For local unit testing you need to install it on the test machine though.

Test Dependencies

Dependency Purpose License
luaunit Unit testing framework BSD License
Mockagne Mocking framework MIT License

Build Dependencies

Dependency Purpose License
LuaRocks Package management MIT License

remotelog-lua's People

Contributors

kaklakariada avatar redcatbear avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

remotelog-lua's Issues

Update workflow to install Lua & LuaRocks via apt-get

As the current GitHub actions runner uses Ubuntu 20.04 which does not contain Lua 5.4 we need to use a custom GH Action, see #21.

Once the runner is updated to Ubuntu 22.04 we can use the following step to install Lua:

      - name: "Install prerequisites"
        run: |
          sudo apt-get update
          sudo apt-get -y install lua${{ matrix.lua_version }} liblua${{ matrix.lua_version }} lua-any luarocks

Rename repository to "remotelog-lua"

Situation

The new package name is remotelog. Since we want to have the language name in the name of a library's repository, the repo should be named remotelog-lua.

Acceptance criteria

  • Repository is renamed
  • All references inside the project are updated

Add developer guide

Situation

Setting up the environment from testing and building a LuaRock is not quite as straight forward as let's say a Java Maven project. We need a developer guide to help contributors to get started.

Acceptance Criteria

  • Developer guide explains how to build the package
  • Developer guide explains how to run the tests

Socket logging

Acceptance Criteria

  • Supports socket logging
  • Falls back to console logging in case the socket connection cannot be opened

Make fallback configurable

Situation

At the moment logging falls back to console logging in case a log connection could not be established. This might not be the right choice for all users and use cases. Instead users should be able to configure that behavior.

Acceptance Criteria

  • Users can set fallback to console
  • Users can fallback to no logging
  • Users can disable fallback, causing an error

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.