Skip to content

The "log" does not output anything to the console, but the "log_err" outputs. #625

Closed

Description

@dmitriy-bodroff

OS: Linux/Ubuntu.

The log does not output anything to the console, but the log_err outputs. Following the documentation, I set the RUST_LOG environment variable as:

$ export RUST_LOG=main,std::io

But log does not write to the console still.

$ ./hello
$

hello.rs

fn main() {
  log "Hello World";
}

For log_err it works:

fn main() {
  log_err "Hello World";
}

$ ./hello
rt: ---
rt: a296:main:main:                   rust: Hello World
$

Activity

  1. marijnh commented on Jul 6, 2011

    @marijnh
    Contributor

    It seems someone updated the code to use the filename as the top-level module scope for log tags if no crate name is defined through the metadata system. So in your case, you need to use RUST_LOG=hello, rather than main. I'll update the wiki.

  2. added a commit that references this issue on Dec 12, 2017
  3. added a commit that references this issue on Jun 3, 2025
  4. added 2 commits that reference this issue on Aug 21, 2026
  5. added a commit that references this issue on Nov 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions