// // ac_log.h - file logging // // Copyright (C) 2006 Nathan (Acorn) Pooley // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License // version 2 as published by the Free Software Foundation. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License (gpl.txt) for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // // You can contact the author, Nathan (Acorn) Pooley, by writing // to Nathan (Acorn) Pooley, 949 Buckeye Drive, Sunnyvale, CA 94086, USA // or through the form at http://www.rawbw.com/~acorn/wand/feedback.html // #ifndef AC_LOG_H #define AC_LOG_H //#@DOC@ debug logging functions //########################################################################### //############################### NOTES ##################################### //########################################################################### // // H H OOO W W TTTTT OOO U U SSSS EEEE // H H O O W W W T O O U U S E // HHHHH O O W W W T O O U U SSS EEE // H H O O WWWWW T O O U U S E // H H OOO W W T OOO UUU SSSS EEEEE // // 1) optionally create a log file with // // +----- use 1 to append to file // | +-- use 1 to make this the default // | | // V V // AcLog *log = AcLogCreate("filename", 0, 0); // // 2) optionally create some source names // // int name = AcLogCreateSource(log,"sourcename"); // // 3) send messages // // AcLogPrintf(log,name,"message %d\n",...); // // use log==0 for default log file // // use name==0 for default source name // // first 2 chars of message are n: then n is debug level (0-9) // // 4) flush/close log file with // AcLogFlush(log); // AcLogDestroy(log); //########################################################################### //############################### TYPEDEFS ################################## //########################################################################### typedef struct AcLogRec AcLog; //########################################################################### //############################### PROTOTYPES ################################ //########################################################################### void AcLogFlush(AcLog *li); void AcLogDestroy(AcLog *li); AcLog *AcLogCreate(char *filename, int append, int isdefault); int AcLogCreateSource(AcLog *li, const char *name); int AcLogPrintf(AcLog *li, int source, const char *fmt, ...); void AcLogWrite(AcLog *li, int source, const char *ptr, unsigned int cnt); void AcLogSetDebugLevel(AcLog *li, int val); void AcLogPrompt(AcLog *li, char *prompt, int force); #endif // AC_LOG_H |
This file Copyright (C) 2006 by Nathan (Acorn) Pooley
Go to TOP Wand page
Go to Acorn's personal webpage
Go to Hogwarts website: www.gotohogwarts.com
Snout: www.snout.org/game
Gadgets of Justice Unlimited
Snout GC (Wiki)
Snout Wiki
File created by do_doc at Wed May 30 03:30:09 PDT 2007