]> gitweb.michael.orlitzky.com - dead/htsn.git/blob - src/Report.hs
Move the TSN namespace (Xml.hs and FeedHosts.hs) into the top level.
[dead/htsn.git] / src / Report.hs
1 -- | Convenience functions for reporting (display and/or logging)
2 -- status messages.
3 --
4 module Report (
5 report_debug,
6 report_error,
7 report_info,
8 report_warning )
9 where
10
11 import Logging (
12 log_debug,
13 log_error,
14 log_info,
15 log_warning )
16 import Terminal (
17 display_debug,
18 display_error,
19 display_info,
20 display_warning )
21
22
23 -- | Display and log debug information. WARNING! This does not
24 -- automatically append a newline. The output is displayed/logged
25 -- as-is, for, you know, debug purposes.
26 report_debug :: String -> IO ()
27 report_debug s = do
28 display_debug s
29 log_debug s
30
31
32 -- | Display and log an error condition. This will prefix the error
33 -- with "ERROR: " when displaying (but not logging) it so that it
34 -- stands out.
35 --
36 report_error :: String -> IO ()
37 report_error s = do
38 display_error $ "ERROR: " ++ s
39 log_error s
40
41
42 -- | Display and log an informational (status) message.
43 --
44 report_info :: String -> IO ()
45 report_info s = do
46 display_info s
47 log_info s
48
49
50 -- | Display and log a warning. This will prefix the warning with
51 -- "WARNING: " when displaying (but not logging) it so that it
52 -- stands out.
53 --
54 report_warning :: String -> IO ()
55 report_warning s = do
56 display_warning $ "WARNING: " ++ s
57 log_warning s