Skip to content

Commit f9ac386

Browse files
committed
fix: always show schema cache load time
It used to be that this was only enabled with log-level=debug. But the default log-level is misleading, for example: ``` $ PGRST_DB_SCHEMAS="apflora" postgrest-with-postgresql-16 -f test/io/big_schema.sql postgrest-run ... 13/Nov/2024:22:08:20 -0500: Config reloaded 13/Nov/2024:22:08:20 -0500: Schema cache queried in 36.3 milliseconds 13/Nov/2024:22:08:20 -0500: Schema cache loaded 326 Relations, 305 Relationships, 7 Functions, 0 Domain Representations, 4 Media Type Handlers, 1194 Timezones ``` The "Schema cache loaded" can take a while to appear, yet the 22:08:20 time is the same. If we reveal the load time this is clarified: ``` 13/Nov/2024:22:08:37 -0500: Schema cache loaded in 16770.1 milliseconds ```
1 parent 2564b32 commit f9ac386

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/PostgREST/Logger.hs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ observationLogger loggerState logLevel obs = case obs of
8787
o@(HasqlPoolObs _) -> do
8888
when (logLevel >= LogDebug) $ do
8989
logWithZTime loggerState $ observationMessage o
90-
o@(SchemaCacheLoadedObs _) -> do
91-
when (logLevel >= LogDebug) $ do
92-
logWithZTime loggerState $ observationMessage o
9390
PoolRequest ->
9491
pure ()
9592
PoolRequestFullfilled ->

0 commit comments

Comments
 (0)