home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SystemLogging.h
-
- Contains: System Logging Service
-
- Version: Technology: 1.0
- Release: Universal Interfaces 3.0d3 on Copland DR1
-
- Copyright: © 1984-1996 by Apple Computer, Inc. All rights reserved.
-
- Bugs?: If you find a problem with this file, send the file and version
- information (from above) and the problem description to:
-
- Internet: apple.bugs@applelink.apple.com
- AppleLink: APPLE.BUGS
-
- */
- #ifndef __SYSTEMLOGGING__
- #define __SYSTEMLOGGING__
-
- #ifndef __TYPES__
- #include <Types.h>
- #endif
- #ifndef __TEXTOBJECTS__
- #include <TextObjects.h>
- #endif
- #ifndef __TIMEOBJECTS__
- #include <TimeObjects.h>
- #endif
- #ifndef __AEDATAMODEL__
- #include <AEDataModel.h>
- #endif
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import on
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=mac68k
- #endif
-
- #if FOR_SYSTEM8_PREEMPTIVE
- #if FOR_PTR_BASED_AE
- /* Service types */
- typedef UInt32 LogID;
- typedef UInt32 LogIterator;
- /* Situation Types */
- typedef UInt32 LogSituationType;
-
- enum {
- kLogTypeInformation = 'info',
- kLogTypeWarning = 'warn',
- kLogTypeFatal = 'fatl',
- kLogTypeSystemFatal = 'sysf',
- kLogTypeAll = '****'
- };
-
- /* System Logging Areas */
- typedef UInt32 LogArea;
-
- enum {
- kLogAreaIO = 'io ',
- kLogAreaNetworking = 'netw',
- kLogAreaKernel = 'kern',
- kLogAreaApplication = 'appl',
- kLogAreaBoot = 'boot',
- kLogAreaPrinting = 'prnt',
- kLogAreaCommunication = 'comm',
- kLogAreaServer = 'serv',
- kLogAreaAll = '****'
- };
-
- /* Service Version */
- typedef UInt32 LogVersion;
-
- enum {
- kLogVersion1 = 1,
- kLogCurrentVersion = kLogVersion1
- };
-
- /* Log Message Versions */
- typedef UInt32 LogMsgVersion;
-
- enum {
- kLogMsgVersion1 = 1,
- kLogCurrentMsgVersion = kLogMsgVersion1
- };
-
- /* Message Flags */
- typedef UInt32 LogMsgFlags;
-
- enum {
- kLogMsgFlagsDataTruncated = 0x00000001,
- kLogMsgFlagsReceivedCorrupted = 0x00000002,
- kLogMsgFlagsTimeInUptime = 0x00000004,
- kLogMsgFlagsNotified = 0x00000008
- };
-
- struct LogMessage {
- ByteCount msgSize;
- LogMsgVersion msgVersion;
- LogMsgFlags msgFlags;
- LogSituationType msgSituationType;
- UInt32 msgRepeatedCount;
- LogArea msgArea;
- OSType msgClient;
- TimeObject msgTimestamp;
- ByteCount msgDataCount;
- OSStatus msgStatus;
- ByteCount msgTextSize;
- };
- typedef struct LogMessage LogMessage;
-
- typedef LogMessage *LogMessagePtr;
-
- enum {
- kLogMaxMessageSize = 1024
- };
-
- typedef UInt32 LogStatisticsVersion;
-
- enum {
- kLogStatisticsVersion1 = 1,
- kLogStatisticsCurrentVersion = kLogStatisticsVersion1
- };
-
- /* System Logging Statistics */
- struct LogStatistics {
- LogStatisticsVersion statsVersion;
- UInt32 situationMsgsDropped;
- UInt32 situationMsgsTruncated;
- UInt32 situationMsgsLoggedThisSession;
- UInt32 situationMsgsCurrentlyInTheLog;
- UInt32 situationMsgsNotified;
- UInt32 pluginsInstalled;
- };
- typedef struct LogStatistics LogStatistics;
-
- /* Variables and constants for use in the System Notication Service */
-
- enum {
- kSystemLoggingService = 'slss',
- kLogSNSMsgKind = 'slsm',
- kLogSNSMsgSubjectSize = 12
- };
-
- #define kLogSNSMsgSubject "SystemLogMsg"
- /* Basic Logging routine */
- extern OSStatus LogSituation(LogSituationType situationType, LogArea situationArea, OSType situationClient, TextObject situationText, OSStatus situationStatus, AEStream situationData);
-
- /* System Logging Service Administration APIs */
- extern OSStatus LogOpen(LogID *theService, TextObject clientName);
-
- extern OSStatus LogClose(LogID theService);
-
- extern OSStatus LogGetClientName(TextObject clientName);
-
- extern OSStatus LogClear(LogID theService);
-
- extern OSStatus LogFlush(LogID theService);
-
- extern OSStatus LogGetCommAreaSize(LogID theService, ByteCount *size);
-
- extern OSStatus LogSetCommAreaSize(LogID theService, ByteCount size);
-
- extern OSStatus LogCreateIterator(LogID theService, LogIterator *iterator);
-
- extern OSStatus LogGetEntry(LogIterator iterator, LogMsgVersion version, LogMessage *msg);
-
- extern OSStatus LogDisposeIterator(LogIterator iterator);
-
- extern OSStatus LogExtractText(LogMessage *entry, TextObject text);
-
- extern OSStatus LogExtractAEDesc(LogMessage *entry, AEDesc *desc);
-
- extern OSStatus LogGetStatistics(LogID theService, LogStatisticsVersion version, LogStatistics *statistics);
-
- extern OSStatus LogGetLogSize(LogID theService, ByteCount *maxSize);
-
- extern OSStatus LogSetLogSize(LogID theService, ByteCount maxSize);
-
- #endif
- #endif
-
- #if PRAGMA_ALIGN_SUPPORTED
- #pragma options align=reset
- #endif
-
- #if PRAGMA_IMPORT_SUPPORTED
- #pragma import off
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
- #endif /* __SYSTEMLOGGING__ */
-
-