Skip to content

Commit b695ad0

Browse files
committed
error_401_with_logger
1 parent 728c316 commit b695ad0

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

sheets/src/eg_sheets_api.e

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ note
55

66
class
77
EG_SHEETS_API
8+
9+
inherit
10+
LOGGABLE
11+
812
create
913
make
1014

1115
feature {NONE} -- Initialization
1216

1317
make (a_access_token: READABLE_STRING_32)
1418
do
19+
default_create
1520
-- Using a code verifier
1621
access_token := a_access_token
1722
enable_version_4
@@ -222,10 +227,10 @@ feature {NONE} -- Implementation
222227
create l_access_token.make_token_secret (access_token, "NOT_NEEDED")
223228
--| Todo improve access_token to create a token without a secret.
224229
if attached l_access_token as ll_access_token then
225-
print ("%NGot the Access Token!%N");
230+
logger.write_information ("internal_api_call->Got the Access Token:" + ll_access_token.token);
226231

227232
--Now let's go and check if the request is signed correcty
228-
print ("%NNow we're going to verify our credentials...%N");
233+
logger.write_information ("internal_api_call->Now we're going to verify our credentials...%N");
229234
-- Build the request and authorize it with OAuth.
230235
create request.make (a_method, a_api_url)
231236
-- Workaorund to make it work with Google API

sheets/src/logger/loggable.e

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,13 @@ class
1010
feature -- Access
1111

1212
logger: LOG_LOGGING_FACILITY
13+
local
14+
l_log_writter: LOG_WRITER_FILE
1315
once
1416
create Result.make
1517
-- Result.set_file_path_sep (l_app_instance_sep.log_file_path_s)
16-
-- Result.register
18+
create l_log_writter
19+
Result.register_log_writer (l_log_writter)
1720
end
1821

1922
end

0 commit comments

Comments
 (0)