xref: /freebsd-src/sys/contrib/openzfs/cmd/zed/zed_log.h (revision be181ee2a28aa2b4b0e76684bce9f673ef668874)
1eda14cbcSMatt Macy /*
2180f8225SMatt Macy  * This file is part of the ZFS Event Daemon (ZED).
3180f8225SMatt Macy  *
4eda14cbcSMatt Macy  * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
5eda14cbcSMatt Macy  * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
616038816SMartin Matuska  * Refer to the OpenZFS git commit log for authoritative copyright attribution.
7eda14cbcSMatt Macy  *
8eda14cbcSMatt Macy  * The contents of this file are subject to the terms of the
9eda14cbcSMatt Macy  * Common Development and Distribution License Version 1.0 (CDDL-1.0).
10eda14cbcSMatt Macy  * You can obtain a copy of the license from the top-level file
11eda14cbcSMatt Macy  * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
12eda14cbcSMatt Macy  * You may not use this file except in compliance with the license.
13eda14cbcSMatt Macy  */
14eda14cbcSMatt Macy 
15eda14cbcSMatt Macy #ifndef	ZED_LOG_H
16eda14cbcSMatt Macy #define	ZED_LOG_H
17eda14cbcSMatt Macy 
18eda14cbcSMatt Macy #include <syslog.h>
19eda14cbcSMatt Macy 
20eda14cbcSMatt Macy void zed_log_init(const char *identity);
21eda14cbcSMatt Macy 
22eda14cbcSMatt Macy void zed_log_fini(void);
23eda14cbcSMatt Macy 
24eda14cbcSMatt Macy void zed_log_pipe_open(void);
25eda14cbcSMatt Macy 
26eda14cbcSMatt Macy void zed_log_pipe_close_reads(void);
27eda14cbcSMatt Macy 
28eda14cbcSMatt Macy void zed_log_pipe_close_writes(void);
29eda14cbcSMatt Macy 
30eda14cbcSMatt Macy void zed_log_pipe_wait(void);
31eda14cbcSMatt Macy 
32eda14cbcSMatt Macy void zed_log_stderr_open(int priority);
33eda14cbcSMatt Macy 
34eda14cbcSMatt Macy void zed_log_stderr_close(void);
35eda14cbcSMatt Macy 
36eda14cbcSMatt Macy void zed_log_syslog_open(int facility);
37eda14cbcSMatt Macy 
38eda14cbcSMatt Macy void zed_log_syslog_close(void);
39eda14cbcSMatt Macy 
40eda14cbcSMatt Macy void zed_log_msg(int priority, const char *fmt, ...);
41eda14cbcSMatt Macy 
42*be181ee2SMartin Matuska __attribute__((format(printf, 1, 2), __noreturn__))
43eda14cbcSMatt Macy void zed_log_die(const char *fmt, ...);
44eda14cbcSMatt Macy 
45eda14cbcSMatt Macy #endif	/* !ZED_LOG_H */
46