Skip to content

williampsena/fake-logger

Repository files navigation

FakeLogger

workflow

This repository provides an application that uses Elixir GenStages to print fake logs to stdout.

Installation

To run locally, I recommend installing Elixir and Erlang as described here .tool-versions file. ASDF is the simplest way to execute Elixir; you can read about ASDF with Elixir here:

So run the following command to install Elixir requirements.

# install rebar and hex
mix local.hex --force &&  mix local.rebar --force

# get all deps
mix deps.get --all

How to run?

After that, we can run the project with mix.

mix run --no-halt

You may test a Docker image from my DockerHub repository:

# docker with delay
docker run -it --rm --env DELAY=5000 docker.io/willsenabr/fake-logger

# podman default delay
podman run -it --rm  docker.io/willsenabr/fake-logger

Container running

Tests

Of course, there is test coverage, which you can run using the command:

mix test

Release

Elixir enables us to produce releases from your project, which is awesome.

MIX_ENV=prod mix release

# starting release
_build/prod/rel/fake_logger/bin/fake_logger start

Code Analysis and Improvements

mix credo -a

Environment variables

  • DELAY specifies how much demand should be consumed in milliseconds.

About

This repository contains an application that prints fake logs to stdout.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published