Pass through to provider LogEntrySearchSession.get_log_entries_by_search
160653
def get_log_entries_by_search(self, log_entry_query, log_entry_search):
        """"""
        # Implemented from azosid template for -
        # osid.resource.ResourceSearchSession.get_resources_by_search_template
        if not self._can('search'):
            raise PermissionDenied()
        return self._provider_session.get_log_entries_by_search(log_entry_query, log_entry_search)
715392
@Override
  public void addEntry(String logType, LogEntry entry) {
    if (!logTypesToInclude.contains(logType)) {
      return;
    }

    if (!localLogs.containsKey(logType)) {
      List<LogEntry> entries = new ArrayList<>();
      entries.add(entry);
      localLogs.put(logType, entries);
    } else {
      localLogs.get(logType).add(entry);
    }
  }
610980
def get_entries(self):
        
        if self.query:
            # Scenario #1: terms matching a search query
            rx = re.compile(re.escape(self.query), re.IGNORECASE)

            def concat_entry(e):
                return (six.text_type(e.msgstr) +
                        six.text_type(e.msgid) +
                        six.text_type(e.msgctxt) +
                        six.text_type(e.comment) +
                        u''.join([o[0] for o in e.occurrences]) +
                        six.text_type(e.msgid_plural) +
                        u''.join(e.msgstr_plural.values())
                        )

            entries = [e_ for e_ in self.po_file
                       if not e_.obsolete and rx.search(concat_entry(e_))]
        else:
            # Scenario #2: filtered list of messages
            if self.msg_filter == 'untranslated':
                entries = self.po_file.untranslated_entries()
            elif self.msg_filter == 'translated':
                entries = self.po_file.translated_entries()
            elif self.msg_filter == 'fuzzy':
                entries = [e_ for e_ in self.po_file.fuzzy_entries()
                           if not e_.obsolete]
            else:
                # ("all")
                entries = [e_ for e_ in self.po_file if not e_.obsolete]
        return entries
873908
def get_log_records_access(f):
    """"""

    @functools.wraps(f)
    def wrapper(request, *args, **kwargs):
        if not django.conf.settings.PUBLIC_LOG_RECORDS:
            trusted(request)
        return f(request, *args, **kwargs)

    return wrapper
1118063
def entries(self):
        """"""
        timer = Timer()
        passwords = []
        logger.info("Scanning %s ..", format_path(self.directory))
        listing = self.context.capture("find", "-type", "f", "-name", "*.gpg", "-print0")
        for filename in split(listing, "\0"):
            basename, extension = os.path.splitext(filename)
            if extension == ".gpg":
                # We use os.path.normpath() to remove the leading `./' prefixes
                # that `find' adds because it searches the working directory.
                passwords.append(PasswordEntry(name=os.path.normpath(basename), store=self))
        logger.verbose("Found %s in %s.", pluralize(len(passwords), "password"), timer)
        return natsort(passwords, key=lambda e: e.name)
808963
def search(self, read_cache=True, **kwparams):
        
        parse_results = False
        of = kwparams.get('of', "")
        if of == "":
            parse_results = True
            of = "xm"
            kwparams['of'] = of
        params = urllib.urlencode(kwparams, doseq=1)

        # Are we running locally? If so, better directly access the
        # search engine directly
        if self.local and of != 't':
            # See if user tries to search any restricted collection
            c = kwparams.get('c', "")
            if c != "":
                if type(c) is list:
                    colls = c
                else:
                    colls = [c]
                for collection in colls:
                    if collection_restricted_p(collection):
                        if self.user:
                            self._check_credentials()
                            continue
                        raise InvenioConnectorAuthError("You are trying to search a restricted collection. Please authenticate yourself.\n")
            kwparams['of'] = 'id'
            results = perform_request_search(**kwparams)
            if of.lower() != 'id':
                results = format_records(results, of)
        else:
            if params + str(parse_results) not in self.cached_queries or not read_cache:
                if self.user:
                    results = self.browser.open(self.server_url + "/search?" + params)
                else:
                    results = urllib2.urlopen(self.server_url + "/search?" + params)
                if 'youraccount/login' in results.geturl():
                    # Current user not able to search collection
                    raise InvenioConnectorAuthError("You are trying to search a restricted collection. Please authenticate yourself.\n")
            else:
                return self.cached_queries[params + str(parse_results)]

        if parse_results:
            # FIXME: we should not try to parse if results is string
            parsed_records = self._parse_results(results, self.cached_records)
            self.cached_queries[params + str(parse_results)] = parsed_records
            return parsed_records
        else:
            # pylint: disable=E1103
            # The whole point of the following code is to make sure we can
            # handle two types of variable.
            try:
                res = results.read()
            except AttributeError:
                res = results
            # pylint: enable=E1103

            if of == "id":
                try:
                    if type(res) is str:
                        # Transform to list
                        res = [int(recid.strip()) for recid in \
                        res.strip("[]").split(",") if recid.strip() != ""]
                    res.reverse()
                except (ValueError, AttributeError):
                    res = []
            self.cached_queries[params + str(parse_results)] = res
            return self.cached_queries[params + str(parse_results)]
1152528
void log(SessionLogEntry entry, String formattedMessage) {
        int level = entry.getLevel();
        Throwable loggedException = entry.getException();

        String msgParm;
        if ((formattedMessage == null || formattedMessage.equals("")) && loggedException != null) {
            msgParm = loggedException.toString();
        } else {
            msgParm = formattedMessage;
        }

        switch (level) {
            case 8:
                return;
            case 7: // SEVERE
                // With the persistence service, only errors will be logged.  The rest will be debug.
                String errMsg = Tr.formatMessage(_stc, "PROVIDER_ERROR_CWWKD0292E", msgParm);
                Tr.error(_tc, errMsg);
                break;
            case 6:// WARN
                String wrnMsg = Tr.formatMessage(_stc, "PROVIDER_WARNING_CWWKD0291W", msgParm);
                Tr.debug(_tc, wrnMsg); // 170432 - move warnings to debug
                break;
            case 3: // FINE
            case 2: // FINER
            case 1: // FINEST
            case 0: // TRACE
                Tr.debug(_tc, formattedMessage);
                break;
        }// end switch

        // if there is an exception - only log it to trace
        if (_tc.isDebugEnabled() && loggedException != null) {
            Tr.debug(_tc, "throwable", loggedException);
        }
    }
66435
public RegistryEntry getEntry(String searchType) {
		for (Map.Entry<Class, RegistryEntry> entry : resources.entrySet()) {
			String type = getResourceType(entry.getKey());
			if (type == null) {
				return null;
			}
			if (type.equals(searchType)) {
				return entry.getValue();
			}
		}
		return null;
	}
1093859
public boolean containsLogEntry(long entryIndex) {
        long sequence = toSequence(entryIndex);
        return sequence >= logs.headSequence() && sequence <= logs.tailSequence();
    }
157446
def view_entries(search_query=None):
    """"""
    query = Entry.select().order_by(Entry.timestamp.desc())
    if search_query:
        query = query.where(Entry.content.contains(search_query))

    for entry in query:
        timestamp = entry.timestamp.strftime('%A %B %d, %Y %I:%M%p')
        print(timestamp)
        print('=' * len(timestamp))
        print(entry.content)
        print('n) next entry')
        print('d) delete entry')
        print('q) return to main menu')
        action = raw_input('Choice? (Ndq) ').lower().strip()
        if action == 'q':
            break
        elif action == 'd':
            entry.delete_instance()
            break
146650
def search(self, read_cache=True, ssl_verify=True, recid=None, **kwparams):
        
        parse_results = False
        of = kwparams.get('of', "")
        if of == "":
            parse_results = True
            of = "xm"
            kwparams['of'] = of
        params = kwparams
        cache_key = (json.dumps(params), parse_results)

        if cache_key not in self.cached_queries or \
                not read_cache:
            if recid:
                results = requests.get(self.server_url + '/record/' + recid,
                                       params=params, cookies=self.cookies,
                                       stream=True, verify=ssl_verify,
                                       allow_redirects=True)
                if results.history:
                    new_recid = urlparse(results.url).path.split('/')[-1]
                    raise InvenioConnectorServerError('The record has been'
                                                      'merged with recid ' +
                                                      new_recid)
            else:
                results = requests.get(self.server_url + "/search",
                                       params=params, cookies=self.cookies,
                                       stream=True, verify=ssl_verify)
            if 'youraccount/login' in results.url:
                # Current user not able to search collection
                raise InvenioConnectorAuthError(
                    "You are trying to search a restricted collection. "
                    "Please authenticate yourself.\n")
        else:
            return self.cached_queries[cache_key]

        if parse_results:
            # FIXME: we should not try to parse if results is string
            parsed_records = self._parse_results(results.raw,
                                                 self.cached_records)
            self.cached_queries[cache_key] = parsed_records
            return parsed_records
        else:
            # pylint: disable=E1103
            # The whole point of the following code is to make sure we can
            # handle two types of variable.
            try:
                res = results.content
            except AttributeError:
                res = results
            # pylint: enable=E1103

            if of == "id":
                try:
                    if isinstance(res, binary_type):
                        # Transform to list
                        res = [int(recid.strip()) for record_id in
                               res.decode('utf-8').strip("[]").split(",")
                               if record_id.strip() != ""]
                    res.reverse()
                except (ValueError, AttributeError):
                    res = []
            self.cached_queries[cache_key] = res
            return res
6679
def get_grade_entries_by_search(self, grade_entry_query, grade_entry_search):
        """"""
        # Implemented from azosid template for -
        # osid.resource.ResourceSearchSession.get_resources_by_search_template
        if not self._can('search'):
            raise PermissionDenied()
        return self._provider_session.get_grade_entries_by_search(grade_entry_query, grade_entry_search)
223369
def get_authorizations_by_search(self, authorization_query, authorization_search):
        """"""
        # Implemented from azosid template for -
        # osid.resource.ResourceSearchSession.get_resources_by_search_template
        if not self._can('search'):
            raise PermissionDenied()
        return self._provider_session.get_authorizations_by_search(authorization_query, authorization_search)
1219288
def use_plenary_log_view(self):
        """"""
        self._log_view = PLENARY
        # self._get_provider_session('log_entry_log_session') # To make sure the session is tracked
        for session in self._get_provider_sessions():
            try:
                session.use_plenary_log_view()
            except AttributeError:
                pass
79796
public void addEntry(String logType, LogEntry entry) {
    if (logTypesToIgnore.contains(logType)) {
      return;
    }

    if (!localLogs.containsKey(logType)) {
      localLogs.put(logType, Lists.newArrayList(entry));
    } else {
      localLogs.get(logType).add(entry);
    }
  }
1052641
def searchlog(self, argv):
        """"""
        opts = cmdline(argv, FLAGS_SEARCHLOG)
        self.foreach(opts.args, lambda job: 
            output(job.searchlog(**opts.kwargs)))
1155730
function logentriesConnect(options={}) {
    // Define path to access specific account, log set and log.
    let pathname = '/'       + encodeURIComponent(options.account) +
                   '/hosts/' + encodeURIComponent(options.logset) +
                   '/'       + encodeURIComponent(options.log) + '/';

    // Bind path argument in query functions.
    let json = logentriesJsonStream.bind(null, pathname);
    let raw  = logentriesRawStream.bind(null, pathname);

    return Object.assign(json, {
        json : json,
        raw  : raw
    });
}