Skip to content

Commit

Permalink
chore(core): print file loading errors to stderr instead of stdout (#237
Browse files Browse the repository at this point in the history
)

Co-authored-by: Nathanael DEMACON <ndemacon@scaleway.com>
  • Loading branch information
cyclimse and quantumsheep committed Jun 28, 2023
1 parent a45bff3 commit 77dc871
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion scaleway-core/scaleway_core/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def __init__(self, client: Client, *, bypass_validation: bool = False):
client.validate()

self.client = client
self._log = logging.getLogger(__name__)
self._log = logging.getLogger("scaleway")

def _request(
self,
Expand Down
5 changes: 4 additions & 1 deletion scaleway-core/scaleway_core/profile/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
from dataclasses import dataclass
from typing import Optional, Type, TypeVar
import sys

import yaml
from scaleway_core import __version__
Expand Down Expand Up @@ -197,7 +198,9 @@ def from_config_file_and_env(
config_profile = cls.from_config_file(filepath, profile_name)
has_config_profile = True
except Exception as e:
print(e)
logging.getLogger("scaleway").warning(
f"Could not load profile from config file: {e}"
)

env_profile = cls.from_env(force_none=has_config_profile)
if has_config_profile:
Expand Down

0 comments on commit 77dc871

Please sign in to comment.