Skip to content
This repository was archived by the owner on Jun 30, 2025. It is now read-only.
This repository was archived by the owner on Jun 30, 2025. It is now read-only.

How to make module specific VERBOSE logging dynamic #494

@anirbanr-fb

Description

@anirbanr-fb

Today at every VLOG_IS_ON site, we cache a vlocal pointer, which points to FLAGS_v if
vmodule was never used on that binary. If that site's logging has been hit one time, I think
it will point to &FLAGS_v and no more to &google::kLogSiteUninitialized.

This will prevent this site to recache a new value of vlocal which could now have been set
using SetVLOGLevel(). How can we achieve module specific dynamic logging in such a case?

I would like a server to be running with verbose logging FLAGS_v = 0 initially. Then instead of
turning on FLAGS_v globally I would like to be selectively turned on for a few files.

This problem also seems to be captured in the comments on the header file.

// NOTE: To change the log level for VLOG(_IS_ON) sites
// that have already executed after/during InitGoogleLogging,
// one needs to supply the exact --vmodule pattern that applied to them.
// (If no --vmodule pattern applied to them
// the value of FLAGS_v will continue to control them.)

which tells that the dynamic nature of these flags can never be an afterthought.

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