Skip to content

GSConfig should not affect log level setting #1323

@thvasilo

Description

@thvasilo

GSConfig is a wrapper object for GraphStorm but it includes code that enforces log level at the application level:

log_level = get_log_level(cmd_args.logging_level) \
if hasattr(cmd_args, "logging_level") else logging.INFO
log_file = cmd_args.logging_file if hasattr(cmd_args, "logging_file") else None
if log_file is None:
# need to force the logging to reset the existing logging handlers
# in order to make sure this config is effective.
logging.basicConfig(level=log_level, force=True)
else:
logging.basicConfig(filename=log_file, level=log_level, force=True)

The caller program should get to establish the logging level, using logging.basicConfig(level=log_level, force=True) overrides user intent, especially when the GraphStorm API is used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions