Example #1
0
def startServer(logLevel =0, router =None, inMaya =None):
    """ Starts the NimbleServer properly given the current environmental conditions. The server runs
        in a separate thread and remains active until the stopServer() method.

        @@@param logLevel:int
            The integer logLevel to use when starting the server. The allowed values are:
            [#list]
                [#item]0 (default): Only log critical actions.[/#item]
                [#item]1: Additionally log warnings as well as succinct activity.[/#item]
                [#item]2: Full verbose logging of all activity.[/#item]
            [/#list]

        @@@param router:NimbleRouter
            The router to use for the server. The default value of None will use the default
            router for the given environment. The router is responsible for handling the
            communication traffic received by the server and correctly responding as a result.

        @@@param inMaya:boolean
            Whether or not the server is being run in Maya. By default this is determined
            automatically by the Nimble environment settings. However, in some cases the
            determination can be incorrect if your external or Maya Python interpreters have been
            modified to fool the environment test. In such cases this may need to be explicitly
            set. """

    NimbleEnvironment.inMaya(override=inMaya)
    NimbleEnvironment.setServerLogLevel(logLevel)
    NimbleServerThread(router=router).start()
Example #2
0
def startServer(logLevel=0, router=None, inMaya=None):
    """ Starts the NimbleServer properly given the current environmental conditions. The server runs
        in a separate thread and remains active until the stopServer() method.

        @@@param logLevel:int
            The integer logLevel to use when starting the server. The allowed values are:
            [#list]
                [#item]0 (default): Only log critical actions.[/#item]
                [#item]1: Additionally log warnings as well as succinct activity.[/#item]
                [#item]2: Full verbose logging of all activity.[/#item]
            [/#list]

        @@@param router:NimbleRouter
            The router to use for the server. The default value of None will use the default
            router for the given environment. The router is responsible for handling the
            communication traffic received by the server and correctly responding as a result.

        @@@param inMaya:boolean
            Whether or not the server is being run in Maya. By default this is determined
            automatically by the Nimble environment settings. However, in some cases the
            determination can be incorrect if your external or Maya Python interpreters have been
            modified to fool the environment test. In such cases this may need to be explicitly
            set. """

    NimbleEnvironment.inMaya(override=inMaya)
    NimbleEnvironment.setServerLogLevel(logLevel)
    NimbleServerThread(router=router).start()
Example #3
0
def changeServerLogLevel(logLevel =0):
    """ Changes the active servers logging level, or, if no server is active, changes the
        environment so that when a server is started it will run at the specified level. This is
        useful if, for example, you want to dynamically change the log level at a given point
        to debug.

        @@@param logLevel:int
            The integer logLevel to use when starting the server. The allowed values are:
            [#list]
                [#item]0 (default): Only log critical actions.[/#item]
                [#item]1: Additionally log warnings as well as succinct activity.[/#item]
                [#item]2: Full verbose logging of all activity.[/#item]
            [/#list] """

    return NimbleEnvironment.setServerLogLevel(logLevel)
Example #4
0
def changeServerLogLevel(logLevel=0):
    """ Changes the active servers logging level, or, if no server is active, changes the
        environment so that when a server is started it will run at the specified level. This is
        useful if, for example, you want to dynamically change the log level at a given point
        to debug.

        @@@param logLevel:int
            The integer logLevel to use when starting the server. The allowed values are:
            [#list]
                [#item]0 (default): Only log critical actions.[/#item]
                [#item]1: Additionally log warnings as well as succinct activity.[/#item]
                [#item]2: Full verbose logging of all activity.[/#item]
            [/#list] """

    return NimbleEnvironment.setServerLogLevel(logLevel)