From 66c1564980ca49d6eb9aa97d0c91f1fe19f5c212 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Mon, 9 Jun 2014 23:51:41 -0700 Subject: [PATCH] Add server-side info logging. --- api.py | 1 + lib/models.py | 2 ++ lib/session.py | 4 ++++ 3 files changed, 7 insertions(+) diff --git a/api.py b/api.py index 16a4880..0a99e22 100644 --- a/api.py +++ b/api.py @@ -197,6 +197,7 @@ class APIWrapper(webapp2.RequestHandler): 'events': [], } for command in self.request_json['commands']: + logging.info('Command: %s', command) callback = self._COMMANDS[command['command']] result = callback( self.verified_google_user, diff --git a/lib/models.py b/lib/models.py index 53a0c86..ae9bf2b 100644 --- a/lib/models.py +++ b/lib/models.py @@ -92,10 +92,12 @@ class Instance(db.Model): @classmethod def FromID(cls, instance_id): + logging.info('Instance: %s', instance_id) return cls.get_by_key_name(instance_id) @classmethod def FindOrCreate(cls, instance_id): + logging.info('Instance: %s', instance_id) return cls.get_or_insert(instance_id) diff --git a/lib/session.py b/lib/session.py index 68268a1..dda2871 100644 --- a/lib/session.py +++ b/lib/session.py @@ -12,6 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. +import logging import functools from google.appengine.ext import db @@ -68,6 +69,9 @@ def session_required(handler): def FindOrCreateSession(self): self.client, old_profile = CreateClientAndProfile( self.request_json['client_id'], self.verified_google_user) + logging.info('Client: %s', self.client.key().name()) + logging.info('Profile: %s', + models.Client.profile.get_value_for_datastore(self.client)) if old_profile: self.client.profile.MergeFrom(old_profile)