Package rrlog :: Package contrib :: Module probarch_sa
[hide private]
[frames] | no frames]

Source Code for Module rrlog.contrib.probarch_sa

 1  #Copyright (c) 2007 
 2  #        Ruben Reifenberg, Germany, 07381. 
 3  #    All rights reserved. 
 4  # 
 5  #Redistribution and use in source and binary forms, with or without 
 6  #modification, are permitted provided that the following conditions 
 7  #are met: 
 8  #1. Redistributions of source code must retain the above copyright 
 9  #   notice, this list of conditions and the following disclaimer as 
10  #   the first lines of this file unmodified. 
11  #2. Redistributions in binary form must reproduce the above copyright 
12  #   notice, this list of conditions and the following disclaimer in the 
13  #   documentation and/or other materials provided with the distribution. 
14  # 
15  # THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 
16  # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
17  # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
18  # ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 
19  # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 
20  # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 
21  # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 
22  # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
23  # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 
24  # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 
25  # SUCH DAMAGE. 
26   
27  """ 
28  @summary: DEPRECATED, replaced by catarch_dbsa. Archives selected messages into own tables/files. 
29  "Selected messages" are messages with certain defined "cat" values. 
30  @author: Ruben Reifenberg 
31  """ 
32   
33  from sqlalchemy import * 
34  from rrlog.server.dbwriter_sa import LOGWRITER_CLASS,MYSQL_ENGINE,createRotatingServer 
35  from rrlog.contrib.catarch_dbsa import createCatArchiver 
36   
37   
38   
39   
40  #--- this is to be compatible with old versions: 
41 -class _BackwardsCompatibilityMetaclass(type):
42 43 #def __call__(self,t=None, tMeta=None, minArchCount=10, minClientArchCount=1, problemCats=None, maxCount=10000):
44 - def __call__(self,*args,**kwargs): #engineStr,drop,tname,tnameMeta,minArchCount=10, minClientArchCount=1, problemCats=None, maxCount=10000):
45 raise DeprecationWarning("Please use createCatArchiver from rrlog.contrib.catarch_dbsa. \nSee also: doc/manual.html#Archive_Messages_by_Category") 46 assert isinstance(engineStr,str) and isinstance(tname,str) and isinstance(tnameMeta,str) and isinstance(drop,bool),"The API has changed since rrlog 0.1.2. Use the createCatArchiver function (see manual)" 47 return createCatArchiver( 48 engineStr=engineStr, 49 tableNamePattern=tname+"_%s", 50 metatableName=tnameMeta, 51 minArchCount=minArchCount, 52 minClientArchCount=minClientArchCount, 53 maxCount=maxCount, 54 cats=problemCats, 55 drop=drop, 56 )
57 -class CatProblemArchiver(object):
58 """ 59 DEPRECATED 60 @deprecated: use the create* function 61 """ 62 __metaclass__ = _BackwardsCompatibilityMetaclass 63
64 - def createTables(engineStr, drop=True, tname="log_probarch", tnameMeta="log_probarch_meta"):
65 """ 66 DEPRECATED 67 @deprecated: Remaining for partial compatibility with version <= 0.1.2 68 """ 69 raise DeprecationWarning("Please use createCatArchiver from rrlog.contrib.catarch_dbsa. \nSee also: doc/manual.html#Archive_Messages_by_Category") 70 return engineStr,drop,tname,tnameMeta
71 createTables = staticmethod(createTables)
72