Logs the current user
4914
public function logUser(User $user)
    {
        $this->strictEventDispatcher->dispatch('log', 'Log\LogUserLogin', array($user));
        $token = new UsernamePasswordToken($user, null, 'main', $user->getRoles());
        $this->container->get('security.token_storage')->setToken($token);
    }
1154438
private String isLoggedIn() throws RuntimeException {
        if(this.getUser() != null && this.getUser().getAuthToken() != null){
            return "CUSTOM " + this.getUser().getAuthToken();
        } else {
            throw new RuntimeException("User state error.");
        }
    }
730332
public function getLoggedUser()
    {
        // Mini cache mechanism to avoid serving a new object each time the function is called.
        if ($this->loggedUser) {
            if ($this->getUserId() == $this->loggedUser->getId()) {
                return $this->loggedUser;
            }
        }
        $this->loggedUser = new UserWrapper(wp_get_current_user());

        return $this->loggedUser;
    }
884199
function doLogin(req, user, callback) {
	req.logIn(user, function(err) {
		if (err) {
			logger.error(err);
			return callback(err);
		}
		user.login_timestamp = Date.now();
		fileUtil.getMetastoreSafe(req).then(function(store) {
			store.updateUser(user.username, user, function(err) {
				if (err) {
					logger.error(err);
					return callback(err);
				}
				callback(null);
			});
		}, function noMetastore(err) {
			callback(err);
		});
	});
}
408056
public function log()
    {
        global $wp_query;

        if (!$wp_query->is_search() || max(1, get_query_var('paged')) > 1) {
            return;
        }

        global $wpdb;

        $query = get_search_query();
        $hits = $wp_query->found_posts;
        $siteId = null;
        $loggedIn = is_user_logged_in();


        if (isset($_COOKIE['search_log']) && is_array(unserialize(stripslashes($_COOKIE['search_log']))) && in_array($query, unserialize(stripslashes($_COOKIE['search_log'])))) {
            return;
        }

        if (is_multisite() && function_exists('get_current_blog_id')) {
            $siteId = get_current_blog_id();
        }

        $insertedId = $wpdb->insert(
            \SearchStatistics\App::$dbTable,
            array(
                'query' => $query,
                'results' => $hits,
                'site_id' => $siteId,
                'logged_in' => $loggedIn
            ),
            array(
                '%s',
                '%d',
                '%d',
                '%d'
            )
        );

        $cookie = array();

        if (isset($_COOKIE['search_log']) && is_array($_COOKIE['search_log'])) {
            $cookie = $_COOKIE['search_log'];
        }

        $cookie[] = $query;

        setcookie('search_log', serialize($cookie), time() + (86400 * 1), "/");
    }
611201
def log(self):
        
        logserv = self.system.request_service('LogStoreService')
        return logserv.lastlog(html=False)
236845
public function logSuccess()
    {
        /** @var XM\SecurityBundle\Entity\User $user */
        $user = $this->tokenStorage->getToken()->getUser();

        if ($user instanceof \XM\SecurityBundle\Entity\User) {
            $user->incrementLoginCount();

            $this->userManager->updateUser($user);

            $this->addLogSuccess($user);
        }
    }
522678
def log(self, *args):
        """"""
        print("%s %s" % (str(self).ljust(8), " ".join([str(x) for x in args])))
284232
def history(self, user=None):
        
        for event in self.changelog:
            when, who, what, old, new, ignore = event
            if (when >= self.options.since.date and
                    when <= self.options.until.date):
                if user is None or who.startswith(user.login):
                    yield who, what, old, new
506860
function(user) {
      if (Parse.User._currentUser !== user) {
        Parse.User.logOut();
      }
      user._isCurrentUser = true;
      Parse.User._currentUser = user;
      Parse.User._currentUserMatchesDisk = true;

      var json = user.toJSON();
      json._id = user.id;
      json._sessionToken = user._sessionToken;
      Parse.localStorage.setItem(
          Parse._getParsePath(Parse.User._CURRENT_USER_KEY),
          JSON.stringify(json));
    }
718763
function log() {
  var _console;

  return Postmate.debug ? (_console = console).log.apply(_console, arguments) : null;
}
3338
function(user) {
        var promise;
        if (AV.User._currentUser !== user) {
          promise = AV.User.logOut();
        } else {
          promise = Promise.resolve();
        }
        return promise.then(function() {
          user._isCurrentUser = true;
          AV.User._currentUser = user;

          var json = user._toFullJSON();
          json._id = user.id;
          json._sessionToken = user._sessionToken;
          return AV.localStorage
            .setItemAsync(
              AV._getAVPath(AV.User._CURRENT_USER_KEY),
              JSON.stringify(json)
            )
            .then(function() {
              AV.User._currentUserMatchesDisk = true;
              return AV._refreshSubscriptionId();
            });
        });
      }
477196
def user(self, login=None):
        '''
        
        '''
        if login:
            url = '%s/user/%s' % (self.domain, login)
        else:
            url = '%s/user' % (self.domain)

        res = self.session.get(url, verify=self.session.verify)
        self._check_response(res)

        return res.json()
1193202
public function log() {
    if (func_num_args() > 0) {
      foreach (func_get_args() as $argument) {
        if (is_array($argument)) echo print_r($argument,true); else echo $argument;
		echo "<br>\n";
      }
    }
  }
901643
async function log(err, auth) {
    if (err.print) {
        console.log(err.message);
    }

    try {
        err = JSON.parse(JSON.stringify(err, Reflect.ownKeys(err)));
    } catch (error) {
        err = err;
    }

    let userId = 'unknown';
    try {
        await firebaseJs.authWithFirebase(auth);
        userId = firebase.auth().currentUser.uid;
    } catch (error) {}

    try {
        let version = 'unkown';
        if (pjson.version) {
            version = pjson.version.replace(/\./g, '_');
        }

        const requestData = {
            userId,
            version,
            err,
            timestamp: {
                ".sv": "timestamp",
            },
        };

        const result = await request({
            url: `${constants.FIREBASE_DATABASE_URL}/logs/errors/${version}/${userId}.json`,
            method: "POST",
            json: true,
            headers: {
                "content-type": "application/json",
            },
            body: requestData,
        });
        // console.log(`Error logged: ${result.name}`);
    } catch (error) {}
    return;
}
870464
def log(self) :
		""""""
		
		self.logs['epochDuration'].append(self.lastEpochDuration)
		self.logs['avg'].append(self.avg)
		self.logs['runtime'].append(self.runtime)
		self.logs['remtime'].append(self.remtime)
392520
def log(self, level, message, *args, **kwargs):
        
        extra = kwargs.pop('extra', {})
        extra.update({
            'user': self.user
        })

        kwargs['extra'] = extra
        super(ServiceLogger, self).log(level, message, *args, **kwargs)