Skip to content

Commit

Permalink
Fixed to work with changes to LogRecordExporterArguments
Browse files Browse the repository at this point in the history
  • Loading branch information
evanlauer1 committed Jul 31, 2024
1 parent 7c35830 commit 58f8451
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions sdk/test/OpenTelemetry/LogRecordProcessorSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ getTestExporter = do
numExportsRef <- newIORef 0
shutdownRef <- newIORef False

let logRecordExporterExportInternal logRecords = do
let logRecordExporterArgumentsExport logRecords = do
shutdown <- readIORef shutdownRef
if shutdown
then pure (Failure Nothing)
Expand All @@ -31,17 +31,17 @@ getTestExporter = do

pure Success

logRecordExporterForceFlushInternal = pure FlushSuccess
logRecordExporterArgumentsForceFlush = pure FlushSuccess

logRecordExporterShutdownInternal = do
logRecordExporterArgumentsShutdown = do
writeIORef shutdownRef True
pure ShutdownSuccess
testExporter <-
mkLogRecordExporter $
LogRecordExporterInternal
{ logRecordExporterExportInternal
, logRecordExporterForceFlushInternal
, logRecordExporterShutdownInternal
LogRecordExporterArguments
{ logRecordExporterArgumentsExport
, logRecordExporterArgumentsForceFlush
, logRecordExporterArgumentsShutdown
}
pure
( numExportsRef
Expand All @@ -53,21 +53,21 @@ getTestExporterWithoutShutdown :: IO (IORef Int, LogRecordExporter)
getTestExporterWithoutShutdown = do
numExportsRef <- newIORef 0

let logRecordExporterExportInternal logRecords = do
let logRecordExporterArgumentsExport logRecords = do
modifyIORef numExportsRef $ (+) $ V.length $ logRecords

pure Success

logRecordExporterForceFlushInternal = pure FlushSuccess
logRecordExporterArgumentsForceFlush = pure FlushSuccess

logRecordExporterShutdownInternal = pure ShutdownSuccess
logRecordExporterArgumentsShutdown = pure ShutdownSuccess

testExporter <-
mkLogRecordExporter $
LogRecordExporterInternal
{ logRecordExporterExportInternal
, logRecordExporterForceFlushInternal
, logRecordExporterShutdownInternal
LogRecordExporterArguments
{ logRecordExporterArgumentsExport
, logRecordExporterArgumentsForceFlush
, logRecordExporterArgumentsShutdown
}
pure
( numExportsRef
Expand Down

0 comments on commit 58f8451

Please sign in to comment.