/* (non-Javadoc)
@see com.popbill.api.StatementService#getLogs(java.lang.String, java.number.Integer, java.lang.String, java.lang.String)
515298
@Override
	public StatementLog[] getLogs(String CorpNum, int ItemCode, String MgtKey)
			throws PopbillException {
		if (MgtKey == null || MgtKey.isEmpty())
			throw new PopbillException(-99999999, "관리번호 가 입력되지 않았습니다.");
		
		return httpget("/Statement/" + ItemCode + "/" + MgtKey + "/Logs",
					CorpNum, null, StatementLog[].class);
	}
1106809
public com.google.api.Logging getLogging() {
    return logging_ == null ? com.google.api.Logging.getDefaultInstance() : logging_;
  }
634668
public static boolean containsLogFromNumber(List<CallLogEntry> logs, String number) {
        for(CallLogEntry log : logs) {
            if(log.number.equals(number)) {
                return true;
            }
        }
        return false;
	}
1048018
def get_logs(self):
        """"""
        # Implemented from kitosid template for -
        # osid.resource.BinLookupSession.get_bins_template
        catalogs = self._get_provider_session('log_lookup_session').get_logs()
        cat_list = []
        for cat in catalogs:
            cat_list.append(Log(self._provider_manager, cat, self._runtime, self._proxy))
        return LogList(cat_list)
526296
public void fetchLogs() {
        try {
            callback.open();
            this.request = getLogRequest(false);
            final HttpResponse response = client.execute(request);
            parseResponse(response);
        } catch (LogCallback.DoneException e) {
            // Signifies we're finished with the log stream.
        } catch (IOException exp) {
            callback.error(exp.getMessage());
        } finally {
            callback.close();
        }
    }
953170
private String getLogFiles(Logger logger) {

        String test = "";
        int count = 0;
        // select the Appender from logger
        for (Appender appender : logger.getAppenders().values()) {
            // only use file appenders
            if (CmsLogFileApp.isFileAppender(appender)) {
                String fileName = CmsLogFileApp.getFileName(appender);
                String temp = "";
                temp = fileName.substring(fileName.lastIndexOf(File.separatorChar) + 1);
                test = test + temp;
                count++;
                break;
            }
        }

        //iterate all parent loggers until a logger with appender was found
        while (!logger.equals(LogManager.getRootLogger())) {

            logger = logger.getParent();
            // if no Appender found from logger, select the Appender from parent logger
            if (count == 0) {
                for (Appender appender : logger.getAppenders().values()) {
                    // only use file appenders
                    if (CmsLogFileApp.isFileAppender(appender)) {
                        String fileName = CmsLogFileApp.getFileName(appender);
                        String temp = "";
                        temp = fileName.substring(fileName.lastIndexOf(File.separatorChar) + 1);
                        test = test + temp;
                        count++;
                        break;
                    }
                }
            }
        }

        return test;
    }
758017
public function getLogs(){
        $rest = $this->getService( self::API_VPN_CLIENT_LOGS);
        $rest->GET();

        return $rest->getResult();
    }
443655
@SuppressWarnings("unchecked")
	private static Collection<LogEntryValue>[][] calculateRequiredLogEntryValues(final Collection<Writer>[][] writers) {
		Collection<LogEntryValue>[][] logEntryValues = new Collection[writers.length][Level.values().length - 1];

		for (int tagIndex = 0; tagIndex < writers.length; ++tagIndex) {
			for (int levelIndex = 0; levelIndex < Level.OFF.ordinal(); ++levelIndex) {
				Set<LogEntryValue> values = EnumSet.noneOf(LogEntryValue.class);
				for (Writer writer : writers[tagIndex][levelIndex]) {
					values.addAll(writer.getRequiredLogEntryValues());
				}
				logEntryValues[tagIndex][levelIndex] = values;
			}
		}

		return logEntryValues;
	}
1266447
@Override
    public LogProperties logProperties()
    {
        if (tc.isDebugEnabled())
            Tr.debug(tc, "logProperties", _fileLogProperties);
        return _fileLogProperties;
    }
1320450
@Nonnull
  @Nonempty
  @OverrideOnDemand
  protected String getLogMessage (@Nullable final Throwable t)
  {
    if (t == null)
      return "An error occurred";
    return "An exception was thrown";
  }
34996
@Override
    public AttachedFile[] getFiles(String CorpNum, MgtKeyType KeyType,
                                   String MgtKey) throws PopbillException {
        if (KeyType == null)
            throw new PopbillException(-99999999, "관리번호형태가 입력되지 않았습니다.");
        if (MgtKey == null || MgtKey.isEmpty())
            throw new PopbillException(-99999999, "관리번호가 입력되지 않았습니다.");

        return httpget("/Taxinvoice/" + KeyType.name() + "/" + MgtKey
                + "/Files", CorpNum, null, AttachedFile[].class);
    }
709217
public java.util.List<String> getExportableLogTypes() {
        if (exportableLogTypes == null) {
            exportableLogTypes = new com.amazonaws.internal.SdkInternalList<String>();
        }
        return exportableLogTypes;
    }
537084
private Logging getLogging() {
    if (logging == null) {
      synchronized (this) {
        if (logging == null) {
          logging = loggingOptions.getService();
        }
      }
    }
    return logging;
  }
653228
public Iterable<RemoteInstanceDetails> getLogLists() {
		ArrayList<RemoteInstanceDetails> result = new ArrayList<RemoteInstanceDetails>();
		for (Date startTime: resultList) {
			result.add(new RemoteInstanceDetails(query, startTime, new String[0]));
		}
		return result;
	}
221681
public static List<GpsLog> getLogsList( IHMConnection connection ) throws Exception {
        List<GpsLog> logsList = new ArrayList<>();
        String sql = "select " + //
                GpsLogsTableFields.COLUMN_ID.getFieldName() + "," + //
                GpsLogsTableFields.COLUMN_LOG_STARTTS.getFieldName() + "," + //
                GpsLogsTableFields.COLUMN_LOG_ENDTS.getFieldName() + "," + //
                GpsLogsTableFields.COLUMN_LOG_TEXT.getFieldName() + //
                " from " + TABLE_GPSLOGS; //
        try (IHMStatement statement = connection.createStatement(); IHMResultSet rs = statement.executeQuery(sql);) {
            statement.setQueryTimeout(30); // set timeout to 30 sec.


            // first get the logs
            while( rs.next() ) {
                long id = rs.getLong(1);

                long startDateTimeString = rs.getLong(2);
                long endDateTimeString = rs.getLong(3);
                String text = rs.getString(4);

                GpsLog log = new GpsLog();
                log.id = id;
                log.startTime = startDateTimeString;
                log.endTime = endDateTimeString;
                log.text = text;
                logsList.add(log);
            }
        }
        return logsList;
    }
1111830
public static String getLog(String code) {
        if (!LOG_CODES.containsKey(code)) {
            throw new LogCodeNotFoundException(code);
        }
        try {
            return String.format(LOG, code, LOG_CODES.get(code), LogCodes.NOTE);
        } catch (Throwable e) {
            throw new LogFormatException(code);
        }
    }
759315
def get_log_entries(self, start_date=None, end_date=None, filters=list(),
                        limit=None):
        '''
        
        '''
        query = text_helper.format_block('''
        SELECT "localhost",
               logs.message,
               logs.level,
               logs.category,
               logs.log_name,
               logs.file_path,
               logs.line_num,
               logs.timestamp
        FROM logs
        WHERE 1
        ''')
        query = self._add_timestamp_condition_sql(query, start_date, end_date)

        def transform_filter(filter):
            level = filter.get('level', None)
            category = filter.get('category', None)
            name = filter.get('name', None)
            if level is None:
                raise AttributeError("level is mandatory parameter.")
            resp = "(logs.level <= %d" % (int(level), )
            if category is not None:
                resp += " AND logs.category == '%s'" % (category, )
            if name is not None:
                resp += " AND logs.log_name == '%s'" % (name, )
            resp += ')'
            return resp

        filter_strings = map(transform_filter, filters)
        if filter_strings:
            query += " AND (%s)\n" % (' OR '.join(filter_strings), )
        query += " ORDER BY logs.timestamp, rowid"
        if limit:
            query += " LIMIT %s" % (limit, )

        d = self._db.runQuery(query)
        d.addCallback(self._decode, entry_type='log')
        return d