Skip to content

Commit

Permalink
Merge branch 'main' into ODSC-57483/add_ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
liudmylaru authored Jun 20, 2024
2 parents 7986f45 + 916a7f5 commit d08bc5e
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions ads/common/oci_logging.py
Original file line number Diff line number Diff line change
Expand Up @@ -614,13 +614,14 @@ def tail(
A list of log records.
Each log record is a dictionary with the following keys: `id`, `time`, `message`.
"""
return self._search_and_format(
tail_logs = self._search_and_format(
source=source,
limit=limit,
sort_order=SortOrder.ASC,
sort_order=SortOrder.DESC,
time_start=time_start,
log_filter=log_filter,
)
return sorted(tail_logs, key=lambda log: log["time"])

def head(
self,
Expand Down Expand Up @@ -854,14 +855,15 @@ def tail(
Expression for filtering the logs. This will be the WHERE clause of the query.
Defaults to None.
"""
tail_logs = self._search_and_format(
source=source,
limit=limit,
sort_order=SortOrder.DESC,
time_start=time_start,
log_filter=log_filter,
)
self._print(
self._search_and_format(
source=source,
limit=limit,
sort_order=SortOrder.ASC,
time_start=time_start,
log_filter=log_filter,
)
sorted(tail_logs, key=lambda log: log["time"])
)

def head(
Expand Down

0 comments on commit d08bc5e

Please sign in to comment.