diff --git a/logging-facade.cabal b/logging-facade.cabal
--- a/logging-facade.cabal
+++ b/logging-facade.cabal
@@ -3,7 +3,7 @@
 -- see: https://github.com/sol/hpack
 
 name:             logging-facade
-version:          0.2.0
+version:          0.3.0
 synopsis:         Simple logging abstraction that allows multiple back-ends
 description:      Simple logging abstraction that allows multiple back-ends
 homepage:         https://github.com/sol/logging-facade#readme
@@ -34,6 +34,7 @@
       Paths_logging_facade
   build-depends:
       base == 4.*
+    , call-stack
     , transformers
   default-language: Haskell2010
 
diff --git a/src/System/Logging/Facade.hs b/src/System/Logging/Facade.hs
--- a/src/System/Logging/Facade.hs
+++ b/src/System/Logging/Facade.hs
@@ -1,8 +1,5 @@
-{-# LANGUAGE CPP #-}
-#if MIN_VERSION_base(4,8,1)
-#define HAS_SOURCE_LOCATIONS
-{-# LANGUAGE ImplicitParams #-}
-#endif
+{-# LANGUAGE FlexibleContexts #-}
+{-# LANGUAGE ConstraintKinds #-}
 -- |
 -- This module is intended to be imported qualified:
 --
@@ -22,49 +19,36 @@
 ) where
 
 import           Prelude hiding (log, error)
+import           Data.CallStack
 
 import           System.Logging.Facade.Types
 import           System.Logging.Facade.Class
 
-#ifdef HAS_SOURCE_LOCATIONS
-#if ! MIN_VERSION_base(4,9,0)
-import           GHC.SrcLoc
-#endif
-import           GHC.Stack
-#define with_loc (?loc :: CallStack) =>
-#else
-#define with_loc
-#endif
-
 -- | Produce a log message with specified log level.
-log :: with_loc Logging m => LogLevel -> String -> m ()
+log :: (HasCallStack, Logging m) => LogLevel -> String -> m ()
 log level message = consumeLogRecord (LogRecord level location message)
-  where
-    location :: Maybe Location
-#ifdef HAS_SOURCE_LOCATIONS
-    location = case reverse (getCallStack ?loc) of
-      (_, loc) : _ -> Just $ Location (srcLocPackage loc) (srcLocModule loc) (srcLocFile loc) (srcLocStartLine loc) (srcLocStartCol loc)
-      _ -> Nothing
-#else
-    location = Nothing
-#endif
 
+location :: HasCallStack => Maybe Location
+location = case reverse callStack of
+  (_, loc) : _ -> Just $ Location (srcLocPackage loc) (srcLocModule loc) (srcLocFile loc) (srcLocStartLine loc) (srcLocStartCol loc)
+  _ -> Nothing
+
 -- | Produce a log message with log level `TRACE`.
-trace :: with_loc Logging m => String -> m ()
+trace :: (HasCallStack, Logging m) => String -> m ()
 trace = log TRACE
 
 -- | Produce a log message with log level `DEBUG`.
-debug :: with_loc Logging m => String -> m ()
+debug :: (HasCallStack, Logging m) => String -> m ()
 debug = log DEBUG
 
 -- | Produce a log message with log level `INFO`.
-info :: with_loc Logging m => String -> m ()
+info :: (HasCallStack, Logging m) => String -> m ()
 info = log INFO
 
 -- | Produce a log message with log level `WARN`.
-warn :: with_loc Logging m => String -> m ()
+warn :: (HasCallStack, Logging m) => String -> m ()
 warn = log WARN
 
 -- | Produce a log message with log level `ERROR`.
-error :: with_loc Logging m => String -> m ()
+error :: (HasCallStack, Logging m) => String -> m ()
 error = log ERROR
