Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7494683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:42:52+00:00 2026-05-29T17:42:52+00:00

Let us say I have a module called example.erl In this module I use

  • 0

Let us say I have a module called example.erl

In this module I use the following construct for debugging:

%%% Switch debugging output on/off:
%-define(DBG(Str, Args), ok).
-define(DBG(Str, Args), io:format(Str, Args)).

It helps me to output various debugging info into the Erlang shell:

?DBG("Function fun1 starting... ~n", [])

But if I call example.erl from example_tests with example:test(), this output info does not appear.

How can I make it visible during a EUnit test?

UPD: I have found some related info, but I still do not know how to solve the issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:42:55+00:00Added an answer on May 29, 2026 at 5:42 pm

    As describe in the page you mention, you can use debugMsg or debugFmt.

    ?debugMsg("Function fun1 starting...")
    

    or

    ?debugFmt("Function fun1 starting...", [])
    

    Make sure you have include eunit’s header file in your module file.

    -include_lib("eunit/include/eunit.hrl").
    

    If you want to disable debug macros for example in staging, define NODEBUG in compiling modules.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let us say if I have a Perl module Resounces.pm with this code snippet
Let say I have abstract class called: Tenant and Customer. The tenant in this
Let's say I have a Foo.fsx script that contains this code: module Bar =
Apologies, somewhat confused Python newbie question. Let's say I have a module called animals.py
Let's say I have a module mod_x like the following: class X: pass x=X()
A simple question on a python module. Let's say I have the following code:
Let's say that I have a module that has a Queue in it. For
Let say I have a module which is the name Metro_Most_Viewed. The module configuration
Let's say I have a perl module file and I want to include and
Let's say I have the following app.js (obviously very simplified): var express = require('express'),

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.