|
|
| version 1.1, 2025/01/19 02:04:04 | version 1.6, 2025/04/01 23:21:45 |
|---|---|
| Line 1 | Line 1 |
| /* | /* |
| * * | * $Id$ |
| * * * | * freem error logging |
| * * * | |
| * *************** | |
| * * * * * | |
| * * MUMPS * | |
| * * * * * | |
| * *************** | |
| * * * | |
| * * * | |
| * * | |
| * | |
| * log.c | |
| * freem error logging | |
| * | * |
| * | * |
| * Author: Serena Willis <jpw@coherent-logic.com> | * Author: Serena Willis <snw@coherent-logic.com> |
| * Copyright (C) 1998 MUG Deutschland | * Copyright (C) 1998 MUG Deutschland |
| * Copyright (C) 2020 Coherent Logic Development LLC | * Copyright (C) 2020, 2025 Coherent Logic Development LLC |
| * | * |
| * | * |
| * This file is part of FreeM. | * This file is part of FreeM. |
| Line 35 | Line 23 |
| * You should have received a copy of the GNU Affero Public License | * You should have received a copy of the GNU Affero Public License |
| * along with FreeM. If not, see <https://www.gnu.org/licenses/>. | * along with FreeM. If not, see <https://www.gnu.org/licenses/>. |
| * | * |
| * $Log$ | |
| * Revision 1.6 2025/04/01 23:21:45 snw | |
| * fmadm commands for stopping, starting, and restarting environments now functional | |
| * | |
| * Revision 1.5 2025/04/01 20:11:46 snw | |
| * Further work on fmadm | |
| * | |
| * Revision 1.4 2025/03/09 19:50:47 snw | |
| * Second phase of REUSE compliance and header reformat | |
| * | |
| * | |
| * SPDX-FileCopyrightText: (C) 2025 Coherent Logic Development LLC | |
| * SPDX-License-Identifier: AGPL-3.0-or-later | |
| **/ | **/ |
| #include <stdio.h> | #include <stdio.h> |
| #include <string.h> | #include <string.h> |
| #if defined(__linux__) | defined(__FreeBSD__) | #if defined(__linux__) | defined(__FreeBSD__) | defined(__sun__) |
| # include <syslog.h> | # include <syslog.h> |
| #endif | #endif |
| #include <stdlib.h> | #include <stdlib.h> |
| Line 49 | Line 50 |
| void m_log (int level, const char *msg) | void m_log (int level, const char *msg) |
| { | { |
| #if defined(__linux__) | defined(__FreeBSD__) | FILE *fp; |
| syslog (level, "%s", msg); | fp = fopen ("/tmp/freem.log", "w+"); |
| #if defined(__linux__) | defined(__FreeBSD__) | defined(__sun__) | |
| syslog (level, "%s", msg); | |
| #endif | #endif |
| fclose (fp); | |
| } | } |